naccyde / rpms / iproute

Forked from rpms/iproute 9 months ago
Clone

Blame SOURCES/0069-tc-f_flower-Add-support-for-matching-first-frag-pack.patch

36cfb7
From 69685a7aa7fb408cce256e469430e10e99a43e2d Mon Sep 17 00:00:00 2001
36cfb7
From: Andrea Claudi <aclaudi@redhat.com>
36cfb7
Date: Mon, 25 Mar 2019 16:54:31 +0100
36cfb7
Subject: [PATCH] tc: f_flower: Add support for matching first frag packets
36cfb7
36cfb7
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1559814
36cfb7
Upstream Status: iproute2.git commit fb4e6abfca2c4
36cfb7
36cfb7
commit fb4e6abfca2c48380210d48c1e7f3685f8bb58fd
36cfb7
Author: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
36cfb7
Date:   Fri Mar 9 11:07:22 2018 +0100
36cfb7
36cfb7
    tc: f_flower: Add support for matching first frag packets
36cfb7
36cfb7
    Add matching support for distinguishing between first and later fragmented
36cfb7
    packets.
36cfb7
36cfb7
     # tc filter add dev eth0 protocol ip parent ffff: \
36cfb7
         flower indev eth0 \
36cfb7
            ip_flags firstfrag \
36cfb7
            ip_proto udp \
36cfb7
        action mirred egress redirect dev eth1
36cfb7
36cfb7
     # tc filter add dev eth0 protocol ip parent ffff: \
36cfb7
         flower indev eth0 \
36cfb7
            ip_flags nofirstfrag \
36cfb7
            ip_proto udp \
36cfb7
        action mirred egress redirect dev eth1
36cfb7
36cfb7
    Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
36cfb7
    Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
36cfb7
    Signed-off-by: Simon Horman <simon.horman@netronome.com>
36cfb7
    Signed-off-by: David Ahern <dsahern@gmail.com>
36cfb7
---
36cfb7
 man/man8/tc-flower.8 | 8 ++++++--
36cfb7
 tc/f_flower.c        | 1 +
36cfb7
 2 files changed, 7 insertions(+), 2 deletions(-)
36cfb7
36cfb7
diff --git a/man/man8/tc-flower.8 b/man/man8/tc-flower.8
36cfb7
index 387f73f5cd2e9..661f42200bdfb 100644
36cfb7
--- a/man/man8/tc-flower.8
36cfb7
+++ b/man/man8/tc-flower.8
36cfb7
@@ -255,8 +255,12 @@ is an 8 bit time-to-live value.
36cfb7
 .BI ip_flags " IP_FLAGS"
36cfb7
 .I IP_FLAGS
36cfb7
 may be either
36cfb7
-.BR frag " or " nofrag
36cfb7
-to match on fragmented packets or not respectively.
36cfb7
+.BR frag ", " nofrag ", " firstfrag " or " nofirstfrag
36cfb7
+where frag and nofrag could be used to match on fragmented packets or not,
36cfb7
+respectively. firstfrag and nofirstfrag can be used to further distinguish
36cfb7
+fragmented packet. firstfrag can be used to indicate the first fragmented
36cfb7
+packet. nofirstfrag can be used to indicates subsequent fragmented packets
36cfb7
+or non-fragmented packets.
36cfb7
 .SH NOTES
36cfb7
 As stated above where applicable, matches of a certain layer implicitly depend
36cfb7
 on the matches of the next lower layer. Precisely, layer one and two matches
36cfb7
diff --git a/tc/f_flower.c b/tc/f_flower.c
36cfb7
index 40dcfbd687a20..e2c7daa0b8e03 100644
36cfb7
--- a/tc/f_flower.c
36cfb7
+++ b/tc/f_flower.c
36cfb7
@@ -162,6 +162,7 @@ struct flag_to_string {
36cfb7
 
36cfb7
 static struct flag_to_string flags_str[] = {
36cfb7
 	{ TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT, FLOWER_IP_FLAGS, "frag" },
36cfb7
+	{ TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST, FLOWER_IP_FLAGS, "firstfrag" },
36cfb7
 };
36cfb7
 
36cfb7
 static int flower_parse_matching_flags(char *str,
36cfb7
-- 
e138d9
2.21.0
36cfb7