All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 1/3] [RFC iproute2-next] tc: f_u32: Rename commands and functions ip6 to ipv6 to unify naming
@ 2021-06-08 15:33 Anton Danilov
  2021-06-08 15:33 ` [RFC 2/3] [RFC iproute2-next] tc: f_u32: Fix the ipv6 pretty printing Anton Danilov
  2021-06-08 15:33 ` [RFC 3/3] [RFC iproute2-next] tc: f_u32: fix the pretty print of ipv4 filters Anton Danilov
  0 siblings, 2 replies; 5+ messages in thread
From: Anton Danilov @ 2021-06-08 15:33 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Anton Danilov

Before patch:
~$ tc filter add dev dummy0 parent 1: protocol ipv6 prio 10 \
    u32 match ip6 src aa:bb:cc:dd::/128 flowid 1:1

After patch:
~$ tc filter add dev dummy0 parent 1: protocol ipv6 prio 10 \
    u32 match ipv6 src aa:bb:cc:dd::/128 flowid 1:1

Signed-off-by: Anton Danilov <littlesmilingcloud@gmail.com>
---
 tc/f_u32.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tc/f_u32.c b/tc/f_u32.c
index 2ed5254a..3fd3eb17 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -35,7 +35,7 @@ static void explain(void)
 		"or         u32 divisor DIVISOR\n"
 		"\n"
 		"Where: SELECTOR := SAMPLE SAMPLE ...\n"
-		"       SAMPLE := { ip | ip6 | udp | tcp | icmp | u{32|16|8} | mark }\n"
+		"       SAMPLE := { ip | ipv6 | udp | tcp | icmp | u{32|16|8} | mark }\n"
 		"                 SAMPLE_ARGS [ divisor DIVISOR ]\n"
 		"       FILTERID := X:Y:Z\n"
 		"\nNOTE: CLASSID is parsed at hexadecimal input.\n");
@@ -356,7 +356,7 @@ static int parse_ip_addr(int *argc_p, char ***argv_p, struct tc_u32_sel *sel,
 	return res;
 }
 
-static int parse_ip6_addr(int *argc_p, char ***argv_p,
+static int parse_ipv6_addr(int *argc_p, char ***argv_p,
 			  struct tc_u32_sel *sel, int off)
 {
 	int res = -1;
@@ -403,7 +403,7 @@ static int parse_ip6_addr(int *argc_p, char ***argv_p,
 	return res;
 }
 
-static int parse_ip6_class(int *argc_p, char ***argv_p, struct tc_u32_sel *sel)
+static int parse_ipv6_class(int *argc_p, char ***argv_p, struct tc_u32_sel *sel)
 {
 	int res = -1;
 	int argc = *argc_p;
@@ -538,7 +538,7 @@ static int parse_ip(int *argc_p, char ***argv_p, struct tc_u32_sel *sel)
 	return res;
 }
 
-static int parse_ip6(int *argc_p, char ***argv_p, struct tc_u32_sel *sel)
+static int parse_ipv6(int *argc_p, char ***argv_p, struct tc_u32_sel *sel)
 {
 	int res = -1;
 	int argc = *argc_p;
@@ -549,13 +549,13 @@ static int parse_ip6(int *argc_p, char ***argv_p, struct tc_u32_sel *sel)
 
 	if (strcmp(*argv, "src") == 0) {
 		NEXT_ARG();
-		res = parse_ip6_addr(&argc, &argv, sel, 8);
+		res = parse_ipv6_addr(&argc, &argv, sel, 8);
 	} else if (strcmp(*argv, "dst") == 0) {
 		NEXT_ARG();
-		res = parse_ip6_addr(&argc, &argv, sel, 24);
-	} else if (strcmp(*argv, "priority") == 0) {
+		res = parse_ipv6_addr(&argc, &argv, sel, 24);
+	} else if (strcmp(*argv, "priority") == 0 || strcmp(*argv, "class") == 0) {
 		NEXT_ARG();
-		res = parse_ip6_class(&argc, &argv, sel);
+		res = parse_ipv6_class(&argc, &argv, sel);
 	} else if (strcmp(*argv, "protocol") == 0) {
 		NEXT_ARG();
 		res = parse_u8(&argc, &argv, sel, 6, 0);
@@ -712,9 +712,9 @@ static int parse_selector(int *argc_p, char ***argv_p,
 	} else if (matches(*argv, "ip") == 0) {
 		NEXT_ARG();
 		res = parse_ip(&argc, &argv, sel);
-	} else	if (matches(*argv, "ip6") == 0) {
+	} else	if (matches(*argv, "ip6") == 0 || matches(*argv, "ipv6") == 0) {
 		NEXT_ARG();
-		res = parse_ip6(&argc, &argv, sel);
+		res = parse_ipv6(&argc, &argv, sel);
 	} else if (matches(*argv, "udp") == 0) {
 		NEXT_ARG();
 		res = parse_udp(&argc, &argv, sel);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-16 10:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-08 15:33 [RFC 1/3] [RFC iproute2-next] tc: f_u32: Rename commands and functions ip6 to ipv6 to unify naming Anton Danilov
2021-06-08 15:33 ` [RFC 2/3] [RFC iproute2-next] tc: f_u32: Fix the ipv6 pretty printing Anton Danilov
2021-06-15  2:57   ` Stephen Hemminger
2021-06-16 10:49     ` Anton Danilov
2021-06-08 15:33 ` [RFC 3/3] [RFC iproute2-next] tc: f_u32: fix the pretty print of ipv4 filters Anton Danilov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.