From: Amit Cohen Date: Tue, 17 Oct 2023 10:55:31 +0000 (+0300) Subject: bridge: fdb: support match on [no]router flag in flush command X-Git-Tag: v6.7.0~48^2~7^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=958eecd2d05a26b664588412891078529b8d2117;p=thirdparty%2Fiproute2.git bridge: fdb: support match on [no]router flag in flush command 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 Acked-by: Nikolay Aleksandrov Signed-off-by: David Ahern --- diff --git a/bridge/fdb.c b/bridge/fdb.c index 8311fa08c..7b4443661 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -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); diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index e3051f890..e5c6064cd 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -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