All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Danilov <littlesmilingcloud@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, Anton Danilov <littlesmilingcloud@gmail.com>
Subject: [PATCH] [RFC iproute2-next] tc: f_u32: Rename commands and functions ip6 to ipv6 to unify naming
Date: Tue,  8 Jun 2021 18:17:39 +0300	[thread overview]
Message-ID: <20210608151739.3220-3-littlesmilingcloud@gmail.com> (raw)
In-Reply-To: <20210608151739.3220-1-littlesmilingcloud@gmail.com>

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


      parent reply	other threads:[~2021-06-08 15:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 15:17 [PATCH] [RFC iproute2-next] tc: f_u32: Fix the ipv6 pretty printing Anton Danilov
2021-06-08 15:17 ` [PATCH] [RFC iproute2-next] tc: f_u32: fix the pretty print of ipv4 filters Anton Danilov
2021-06-08 15:17 ` Anton Danilov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210608151739.3220-3-littlesmilingcloud@gmail.com \
    --to=littlesmilingcloud@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.