[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220608122921.3962382-9-razor@blackwall.org>
Date: Wed, 8 Jun 2022 15:29:19 +0300
From: Nikolay Aleksandrov <razor@...ckwall.org>
To: netdev@...r.kernel.org
Cc: dsahern@...il.com, stephen@...workplumber.org, roopa@...dia.com,
Nikolay Aleksandrov <razor@...ckwall.org>
Subject: [PATCH iproute2-next 08/10] bridge: fdb: add flush [no]extern_learn entry matching
Add flush support to match entries with or without (if "no" is
prepended) extern_learn flag.
Examples:
$ bridge fdb flush dev br0 extern_learn
This will delete all extern_learn entries in br0's fdb table.
$ bridge fdb flush dev br0 noextern_learn
This will delete all entries except the ones with extern_learn flag in
br0's fdb table.
Signed-off-by: Nikolay Aleksandrov <razor@...ckwall.org>
---
bridge/fdb.c | 8 +++++++-
man/man8/bridge.8 | 7 ++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/bridge/fdb.c b/bridge/fdb.c
index c57ad235b401..e64e21cb0cba 100644
--- a/bridge/fdb.c
+++ b/bridge/fdb.c
@@ -47,7 +47,7 @@ static void usage(void)
" [ vlan VID ] [ vni VNI ] [ self ] [ master ] [ dynamic ]\n"
" bridge fdb flush dev DEV [ brport DEV ] [ vlan VID ]\n"
" [ self ] [ master ] [ [no]permanent | [no]static | [no]dynamic ]\n"
- " [ [no]added_by_user ]\n");
+ " [ [no]added_by_user ] [ [no]extern_learn ]\n");
exit(-1);
}
@@ -720,6 +720,12 @@ static int fdb_flush(int argc, char **argv)
} else if (strcmp(*argv, "noadded_by_user") == 0) {
ndm_flags &= ~NTF_USE;
ndm_flags_mask |= NTF_USE;
+ } else if (strcmp(*argv, "extern_learn") == 0) {
+ ndm_flags |= NTF_EXT_LEARNED;
+ ndm_flags_mask |= NTF_EXT_LEARNED;
+ } else if (strcmp(*argv, "noextern_learn") == 0) {
+ ndm_flags &= ~NTF_EXT_LEARNED;
+ ndm_flags_mask |= NTF_EXT_LEARNED;
} else if (strcmp(*argv, "brport") == 0) {
if (port)
duparg2("brport", *argv);
diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
index b39c74823606..af343cc1a719 100644
--- a/man/man8/bridge.8
+++ b/man/man8/bridge.8
@@ -122,7 +122,7 @@ bridge \- show / manipulate bridge addresses and devices
.IR VID " ] [ "
.BR self " ] [ " master " ] [ "
.BR [no]permanent " | " [no]static " | " [no]dynamic " ] [ "
-.BR [no]added_by_user " ]"
+.BR [no]added_by_user " ] [ " [no]extern_learn " ]"
.ti -8
.BR "bridge mdb" " { " add " | " del " } "
@@ -849,6 +849,11 @@ is prepended then only non-dynamic (static or permanent) entries will be deleted
.B [no]added_by_user
if specified then only entries with added_by_user flag will be deleted or respectively
if "no" is prepended then only entries without added_by_user flag will be deleted.
+
+.TP
+.B [no]extern_learn
+if specified then only entries with extern_learn flag will be deleted or respectively
+if "no" is prepended then only entries without extern_learn flag will be deleted.
.sp
.SH bridge mdb - multicast group database management
--
2.35.1
Powered by blists - more mailing lists