aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEyal Birger <eyal.birger@gmail.com>2022-03-19 10:57:40 +0200
committerDavid Ahern <dsahern@kernel.org>2022-03-20 17:54:19 -0600
commit418481002fdc76a3b7caa17dc21b94cf1c4ff1c1 (patch)
tree7f80f9f20d03cc8b95797572bfb3512ec8c0caee
parentbb2cd5f3d9e63ce9f17c7996aa1dd11b63a87af3 (diff)
downloadiproute2-418481002fdc76a3b7caa17dc21b94cf1c4ff1c1.tar.gz
ip/geneve: add support for IFLA_GENEVE_INNER_PROTO_INHERIT
Add support for creating devices with this property. Since it cannot be changed, not adding a [no] option. Signed-off-by: Eyal Birger <eyal.birger@gmail.com> Signed-off-by: David Ahern <dsahern@kernel.org>
-rw-r--r--ip/iplink_geneve.c13
-rw-r--r--man/man8/ip-link.8.in6
2 files changed, 19 insertions, 0 deletions
diff --git a/ip/iplink_geneve.c b/ip/iplink_geneve.c
index 78fc818e0..98099cc9e 100644
--- a/ip/iplink_geneve.c
+++ b/ip/iplink_geneve.c
@@ -31,6 +31,7 @@ static void print_explain(FILE *f)
" [ [no]udpcsum ]\n"
" [ [no]udp6zerocsumtx ]\n"
" [ [no]udp6zerocsumrx ]\n"
+ " [ innerprotoinherit ]\n"
"\n"
"Where: VNI := 0-16777215\n"
" ADDR := IP_ADDRESS\n"
@@ -72,6 +73,7 @@ static int geneve_parse_opt(struct link_util *lu, int argc, char **argv,
__u64 attrs = 0;
bool set_op = (n->nlmsg_type == RTM_NEWLINK &&
!(n->nlmsg_flags & NLM_F_CREATE));
+ bool inner_proto_inherit = false;
inet_prefix_reset(&daddr);
@@ -182,6 +184,10 @@ static int geneve_parse_opt(struct link_util *lu, int argc, char **argv,
check_duparg(&attrs, IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
*argv, *argv);
udp6zerocsumrx = 0;
+ } else if (!strcmp(*argv, "innerprotoinherit")) {
+ check_duparg(&attrs, IFLA_GENEVE_INNER_PROTO_INHERIT,
+ *argv, *argv);
+ inner_proto_inherit = true;
} else if (matches(*argv, "help") == 0) {
explain();
return -1;
@@ -231,6 +237,8 @@ static int geneve_parse_opt(struct link_util *lu, int argc, char **argv,
addattr16(n, 1024, IFLA_GENEVE_PORT, htons(dstport));
if (metadata)
addattr(n, 1024, IFLA_GENEVE_COLLECT_METADATA);
+ if (inner_proto_inherit)
+ addattr(n, 1024, IFLA_GENEVE_INNER_PROTO_INHERIT);
if (GENEVE_ATTRSET(attrs, IFLA_GENEVE_UDP_CSUM))
addattr8(n, 1024, IFLA_GENEVE_UDP_CSUM, udpcsum);
if (GENEVE_ATTRSET(attrs, IFLA_GENEVE_UDP_ZERO_CSUM6_TX))
@@ -365,6 +373,11 @@ static void geneve_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
fputs("udp6zerocsumrx ", f);
}
}
+
+ if (tb[IFLA_GENEVE_INNER_PROTO_INHERIT]) {
+ print_bool(PRINT_ANY, "inner_proto_inherit",
+ "innerprotoinherit ", true);
+ }
}
static void geneve_print_help(struct link_util *lu, int argc, char **argv,
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index 7a6753747..ee189abc3 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -1259,6 +1259,8 @@ the following additional arguments are supported:
.RB [ no ] udp6zerocsumtx
] [
.RB [ no ] udp6zerocsumrx
+] [
+.B innerprotoinherit
]
.in +8
@@ -1322,6 +1324,10 @@ options.
.RB [ no ] udp6zerocsumrx
- allow incoming UDP packets over IPv6 with zero checksum field.
+.sp
+.B innerprotoinherit
+- use IPv4/IPv6 as inner protocol instead of Ethernet.
+
.in -8
.TP