From: Petr Machata Date: Wed, 18 Jun 2025 15:44:43 +0000 (+0200) Subject: ip: VXLAN: Add support for IFLA_VXLAN_MC_ROUTE X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6331444995237782f4bdfae7d3cbef7f319d323c;p=thirdparty%2Fiproute2.git ip: VXLAN: Add support for IFLA_VXLAN_MC_ROUTE The flag controls whether underlay packets should be MC-routed or (default) sent to the indicated physical netdevice. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David Ahern --- diff --git a/ip/iplink_vxlan.c b/ip/iplink_vxlan.c index 9649a8eb..a6e95398 100644 --- a/ip/iplink_vxlan.c +++ b/ip/iplink_vxlan.c @@ -37,6 +37,7 @@ static const struct vxlan_bool_opt { { "remcsum_tx", IFLA_VXLAN_REMCSUM_TX, false }, { "remcsum_rx", IFLA_VXLAN_REMCSUM_RX, false }, { "localbypass", IFLA_VXLAN_LOCALBYPASS, true }, + { "mcroute", IFLA_VXLAN_MC_ROUTE, false }, }; static void print_explain(FILE *f) @@ -67,6 +68,7 @@ static void print_explain(FILE *f) " [ [no]localbypass ]\n" " [ [no]external ] [ gbp ] [ gpe ]\n" " [ [no]vnifilter ]\n" + " [ [no]mcroute ]\n" "\n" "Where: VNI := 0-16777215\n" " ADDR := { IP_ADDRESS | any }\n" @@ -378,6 +380,14 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv, check_duparg(&attrs, IFLA_VXLAN_VNIFILTER, *argv, *argv); addattr8(n, 1024, IFLA_VXLAN_VNIFILTER, 0); + } else if (!strcmp(*argv, "mcroute")) { + check_duparg(&attrs, IFLA_VXLAN_MC_ROUTE, + *argv, *argv); + addattr8(n, 1024, IFLA_VXLAN_MC_ROUTE, 1); + } else if (!strcmp(*argv, "nomcroute")) { + check_duparg(&attrs, IFLA_VXLAN_MC_ROUTE, + *argv, *argv); + addattr8(n, 1024, IFLA_VXLAN_MC_ROUTE, 0); } else if (matches(*argv, "help") == 0) { explain(); return -1; diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index 91fa0cf1..e3297c57 100644 --- a/man/man8/ip-link.8.in +++ b/man/man8/ip-link.8.in @@ -663,6 +663,8 @@ the following additional arguments are supported: .B gpe ] [ .RB [ no ] vnifilter +] [ +.RB [ no ] mcroute ] .in +8 @@ -796,6 +798,14 @@ device with external flag set. once enabled, bridge vni command is used to manag vni filtering table on the device. The device can only receive packets with vni's configured in the vni filtering table. +.sp +.RB [ no ] mcroute +- when the VXLAN tunnel has a multicast remote, whether the underlay packets +should be sent directly to the physical device (the default), or whether they +should be multicast-routed. In the latter case, for purposes of matching a +multicast route, (S,G) are, respectively, local and remote address of the +tunnel, and iif is the tunnel physical device. + .sp .B gbp - enables the Group Policy extension (VXLAN-GBP).