From: Tom Herbert <tom@herbertland.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>, <shemming@brocade.com>
Cc: <kernel-team@fb.com>, <haoxuany@fb.com>,
Tom Herbert <tom@herbertland.com>
Subject: [PATCH iproute 5/5] fou: Allowing configuring IPv6 listener
Date: Thu, 14 Jul 2016 12:22:16 -0700 [thread overview]
Message-ID: <1468524136-3389846-6-git-send-email-tom@herbertland.com> (raw)
In-Reply-To: <1468524136-3389846-1-git-send-email-tom@herbertland.com>
Signed-off-by: Tom Herbert <tom@herbertland.com>
---
ip/ipfou.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/ip/ipfou.c b/ip/ipfou.c
index 2a6ae17..d584a02 100644
--- a/ip/ipfou.c
+++ b/ip/ipfou.c
@@ -25,8 +25,8 @@
static void usage(void)
{
- fprintf(stderr, "Usage: ip fou add port PORT { ipproto PROTO | gue }\n");
- fprintf(stderr, " ip fou del port PORT\n");
+ fprintf(stderr, "Usage: ip fou add port PORT { ipproto PROTO | gue } [ -6 ]\n");
+ fprintf(stderr, " ip fou del port PORT [ -6 ]\n");
fprintf(stderr, "\n");
fprintf(stderr, "Where: PROTO { ipproto-name | 1..255 }\n");
fprintf(stderr, " PORT { 1..65535 }\n");
@@ -50,6 +50,7 @@ static int fou_parse_opt(int argc, char **argv, struct nlmsghdr *n,
__u8 ipproto, type;
bool gue_set = false;
int ipproto_set = 0;
+ unsigned short family = AF_INET;
while (argc > 0) {
if (!matches(*argv, "port")) {
@@ -71,6 +72,8 @@ static int fou_parse_opt(int argc, char **argv, struct nlmsghdr *n,
ipproto_set = 1;
} else if (!matches(*argv, "gue")) {
gue_set = true;
+ } else if (!matches(*argv, "-6")) {
+ family = AF_INET6;
} else {
fprintf(stderr, "fou: unknown command \"%s\"?\n", *argv);
usage();
@@ -98,6 +101,7 @@ static int fou_parse_opt(int argc, char **argv, struct nlmsghdr *n,
addattr16(n, 1024, FOU_ATTR_PORT, port);
addattr8(n, 1024, FOU_ATTR_TYPE, type);
+ addattr16(n, 1024, FOU_ATTR_AF, family);
if (ipproto_set)
addattr8(n, 1024, FOU_ATTR_IPPROTO, ipproto);
--
2.8.0.rc2
next prev parent reply other threads:[~2016-07-14 19:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-14 19:22 [PATCH iproute 0/5] iproute: ila and fou additions Tom Herbert
2016-07-14 19:22 ` [PATCH iproute 1/5] ila: Support for checksum neutral translation Tom Herbert
2016-07-14 19:22 ` [PATCH iproute 2/5] ila: Support for configuring ila to use netfilter hook Tom Herbert
2016-07-14 19:22 ` [PATCH iproute 3/5] ip6tnl: Support for fou encapsulation Tom Herbert
2016-07-14 19:22 ` [PATCH iproute 4/5] gre6: " Tom Herbert
2016-07-14 19:22 ` Tom Herbert [this message]
2016-07-15 18:23 ` [PATCH iproute 0/5] iproute: ila and fou additions Stephen Hemminger
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=1468524136-3389846-6-git-send-email-tom@herbertland.com \
--to=tom@herbertland.com \
--cc=davem@davemloft.net \
--cc=haoxuany@fb.com \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
--cc=shemming@brocade.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).