]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip: VXLAN: Add support for IFLA_VXLAN_MC_ROUTE
authorPetr Machata <petrm@nvidia.com>
Wed, 18 Jun 2025 15:44:43 +0000 (17:44 +0200)
committerDavid Ahern <dsahern@kernel.org>
Sun, 22 Jun 2025 16:52:06 +0000 (16:52 +0000)
The flag controls whether underlay packets should be MC-routed or (default)
sent to the indicated physical netdevice.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/iplink_vxlan.c
man/man8/ip-link.8.in

index 9649a8eb6166e59b32f8229707a0f040ad6a13a7..a6e95398c883f863f1a413ba56a44c337df9cd5b 100644 (file)
@@ -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;
index 91fa0cf142d70d585ac236301361cf69d290f620..e3297c5771522fc782b7d7d8ba87a7b6d6408df9 100644 (file)
@@ -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).