]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge: fdb: support match on [no]router flag in flush command
authorAmit Cohen <amcohen@nvidia.com>
Tue, 17 Oct 2023 10:55:31 +0000 (13:55 +0300)
committerDavid Ahern <dsahern@kernel.org>
Fri, 20 Oct 2023 15:43:05 +0000 (09:43 -0600)
Extend "fdb flush" command to match entries with or without (if "no" is
prepended) router flag.

Examples:
$ bridge fdb flush dev vx10 router
This will delete all fdb entries pointing to vx10 with router flag.

$ bridge fdb flush dev vx10 norouter
This will delete all fdb entries pointing to vx10, except the ones with
router flag.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
bridge/fdb.c
man/man8/bridge.8

index 8311fa08c6668d5496466b447dd26d085ba41298..7b4443661e6b879e4f60ac68096fcec498a9a477 100644 (file)
@@ -49,7 +49,7 @@ static void usage(void)
                "              [ nhid NHID ] [ vni VNI ] [ port PORT ] [ dst IPADDR ] [ self ]\n"
                "              [ master ] [ [no]permanent | [no]static | [no]dynamic ]\n"
                "              [ [no]added_by_user ] [ [no]extern_learn ] [ [no]sticky ]\n"
-               "              [ [no]offloaded ]\n");
+               "              [ [no]offloaded ] [ [no]router ]\n");
        exit(-1);
 }
 
@@ -759,6 +759,12 @@ static int fdb_flush(int argc, char **argv)
                } else if (strcmp(*argv, "nooffloaded") == 0) {
                        ndm_flags &= ~NTF_OFFLOADED;
                        ndm_flags_mask |= NTF_OFFLOADED;
+               } else if (strcmp(*argv, "router") == 0) {
+                       ndm_flags |= NTF_ROUTER;
+                       ndm_flags_mask |= NTF_ROUTER;
+               } else if (strcmp(*argv, "norouter") == 0) {
+                       ndm_flags &= ~NTF_ROUTER;
+                       ndm_flags_mask |= NTF_ROUTER;
                } else if (strcmp(*argv, "brport") == 0) {
                        if (brport)
                                duparg2("brport", *argv);
index e3051f890b1f5082fb25c3bcd643598ad9c804d6..e5c6064cd4a817078722f1c0ea07280e852e8cdb 100644 (file)
@@ -141,7 +141,7 @@ bridge \- show / manipulate bridge addresses and devices
 .BR self " ] [ " master " ] [ "
 .BR [no]permanent " | " [no]static " | " [no]dynamic " ] [ "
 .BR [no]added_by_user " ] [ " [no]extern_learn " ] [ "
-.BR [no]sticky " ] [ " [no]offloaded " ]"
+.BR [no]sticky " ] [ " [no]offloaded " ] [ " [no]router " ]"
 
 .ti -8
 .BR "bridge mdb" " { " add " | " del " | " replace " } "
@@ -980,6 +980,13 @@ if specified then only entries with offloaded flag will be deleted or respective
 if "no" is prepended then only entries without offloaded flag will be deleted.
 .sp
 
+.TP
+.B [no]router
+if specified then only entries with router flag will be deleted or respectively
+if "no" is prepended then only entries without router flag will be deleted. Valid
+if the referenced device is a VXLAN type device.
+.sp
+
 .SH bridge mdb - multicast group database management
 
 .B mdb