bridge: netlink: allow to flush port's fdb
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Tue, 6 Oct 2015 12:12:01 +0000 (14:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Oct 2015 11:49:32 +0000 (04:49 -0700)
Add IFLA_BRPORT_FLUSH to allow flushing port's fdb similar to sysfs's
flush.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/if_link.h
net/bridge/br_netlink.c

index 9c17f605e013023341328b8d5bab0a0dc805b838..fcea39a56095fe55d0e37b0a2a4b839b5ebaa4d7 100644 (file)
@@ -303,6 +303,7 @@ enum {
        IFLA_BRPORT_MESSAGE_AGE_TIMER,
        IFLA_BRPORT_FORWARD_DELAY_TIMER,
        IFLA_BRPORT_HOLD_TIMER,
+       IFLA_BRPORT_FLUSH,
        __IFLA_BRPORT_MAX
 };
 #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
index 04b0e5072686d8a20a34ffcc61a3cd3c610dc0d0..6468166d6bdc9f0ef721a782e370187806b01984 100644 (file)
@@ -631,6 +631,9 @@ static int br_setport(struct net_bridge_port *p, struct nlattr *tb[])
                        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);
        return 0;
 }