@@ -45,6 +45,7 @@ static void print_explain(FILE *f)
" [ [no]remcsumtx ] [ [no]remcsumrx ]\n"
" [ [no]external ] [ gbp ] [ gpe ]\n"
" [ [no]vnifilter ]\n"
+ " [ [no]localbypass ]\n"
"\n"
"Where: VNI := 0-16777215\n"
" ADDR := { IP_ADDRESS | any }\n"
@@ -276,6 +277,12 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
} else if (!matches(*argv, "noudpcsum")) {
check_duparg(&attrs, IFLA_VXLAN_UDP_CSUM, *argv, *argv);
addattr8(n, 1024, IFLA_VXLAN_UDP_CSUM, 0);
+ } else if (0 == strcmp(*argv, "localbypass")) {
+ check_duparg(&attrs, IFLA_VXLAN_LOCALBYPASS, *argv, *argv);
+ addattr8(n, 1024, IFLA_VXLAN_LOCALBYPASS, 1);
+ } else if (0 == strcmp(*argv, "nolocalbypass")) {
+ check_duparg(&attrs, IFLA_VXLAN_LOCALBYPASS, *argv, *argv);
+ addattr8(n, 1024, IFLA_VXLAN_LOCALBYPASS, 0);
} else if (!matches(*argv, "udp6zerocsumtx")) {
check_duparg(&attrs, IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
*argv, *argv);
@@ -613,6 +620,18 @@ static void vxlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
}
}
+ if (tb[IFLA_VXLAN_LOCALBYPASS]) {
+ __u8 localbypass = rta_getattr_u8(tb[IFLA_VXLAN_LOCALBYPASS]);
+
+ if (is_json_context()) {
+ print_bool(PRINT_ANY, "localbypass", NULL, localbypass);
+ } else {
+ if (!localbypass)
+ fputs("no", f);
+ fputs("localbypass ", f);
+ }
+ }
+
if (tb[IFLA_VXLAN_UDP_ZERO_CSUM6_TX]) {
__u8 csum6 = rta_getattr_u8(tb[IFLA_VXLAN_UDP_ZERO_CSUM6_TX]);
@@ -623,6 +623,8 @@ the following additional arguments are supported:
] [
.RB [ no ] udpcsum
] [
+.RB [ no ] localbypass
+] [
.RB [ no ] udp6zerocsumtx
] [
.RB [ no ] udp6zerocsumrx
@@ -727,6 +729,12 @@ are entered into the VXLAN device forwarding database.
.RB [ no ] udpcsum
- specifies if UDP checksum is calculated for transmitted packets over IPv4.
+.sp
+.RB [ no ] localbypass
+- if fdb destination is local, but there is no corresponding vni, forward packets
+to the userspace network stack. Supposedly, there may be a userspace process
+listening for these packets.
+
.sp
.RB [ no ] udp6zerocsumtx
- skip UDP checksum calculation for transmitted packets over IPv6.
Add userspace support for the nolocalbypass vxlan netlink attribute. With nolocalbypass, if an entry is pointing to the local machine, but the system driver is not listening on this port, the driver will not drop packets, but will forward them to the userspace network stack instead. Signed-off-by: Vladimir Nikishkin <vladimir@nikishkin.pw> --- ip/iplink_vxlan.c | 19 +++++++++++++++++++ man/man8/ip-link.8.in | 8 ++++++++ 2 files changed, 27 insertions(+)