diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2014-01-10 13:58:47 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-13 23:42:39 -0800 |
commit | b86f81cca9442ce6cfbe76d10fb8d2c61122ae12 (patch) | |
tree | 2bea049dae33c9c5fe6a4191a796bea02b4af48e /net/bridge/br.c | |
parent | ae237b3ede6481d28daa62be44a8061d15912436 (diff) | |
download | op-kernel-dev-b86f81cca9442ce6cfbe76d10fb8d2c61122ae12.zip op-kernel-dev-b86f81cca9442ce6cfbe76d10fb8d2c61122ae12.tar.gz |
bridge: move br_net_exit() to br.c
And it can become static.
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br.c')
-rw-r--r-- | net/bridge/br.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/net/bridge/br.c b/net/bridge/br.c index ba780cc..19311aaf 100644 --- a/net/bridge/br.c +++ b/net/bridge/br.c @@ -22,14 +22,29 @@ #include "br_private.h" -static const struct stp_proto br_stp_proto = { - .rcv = br_stp_rcv, -}; +static void __net_exit br_net_exit(struct net *net) +{ + struct net_device *dev; + LIST_HEAD(list); + + rtnl_lock(); + for_each_netdev(net, dev) + if (dev->priv_flags & IFF_EBRIDGE) + br_dev_delete(dev, &list); + + unregister_netdevice_many(&list); + rtnl_unlock(); + +} static struct pernet_operations br_net_ops = { .exit = br_net_exit, }; +static const struct stp_proto br_stp_proto = { + .rcv = br_stp_rcv, +}; + static int __init br_init(void) { int err; |