Commit 9b0c6e4d authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by David S. Miller

bridge: netlink: allow to flush port's fdb

Add IFLA_BRPORT_FLUSH to allow flushing port's fdb similar to sysfs's
flush.
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 61c0a9a8
...@@ -303,6 +303,7 @@ enum { ...@@ -303,6 +303,7 @@ enum {
IFLA_BRPORT_MESSAGE_AGE_TIMER, IFLA_BRPORT_MESSAGE_AGE_TIMER,
IFLA_BRPORT_FORWARD_DELAY_TIMER, IFLA_BRPORT_FORWARD_DELAY_TIMER,
IFLA_BRPORT_HOLD_TIMER, IFLA_BRPORT_HOLD_TIMER,
IFLA_BRPORT_FLUSH,
__IFLA_BRPORT_MAX __IFLA_BRPORT_MAX
}; };
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
......
...@@ -631,6 +631,9 @@ static int br_setport(struct net_bridge_port *p, struct nlattr *tb[]) ...@@ -631,6 +631,9 @@ static int br_setport(struct net_bridge_port *p, struct nlattr *tb[])
return err; return err;
} }
if (tb[IFLA_BRPORT_FLUSH])
br_fdb_delete_by_port(p->br, p, 0, 0);
br_port_flags_change(p, old_flags ^ p->flags); br_port_flags_change(p, old_flags ^ p->flags);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment