]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/bridge/br.c
Merge branch 'master' into staging-next
[karo-tx-linux.git] / net / bridge / br.c
index f20c4fd915a8991ef86cd3a76b61b0c8cb08f4bb..19311aafcf5a06e6ae7abaaf82527711573dc6d6 100644 (file)
 
 #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;
@@ -62,7 +77,7 @@ static int __init br_init(void)
 
        brioctl_set(br_ioctl_deviceless_stub);
 
-#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
+#if IS_ENABLED(CONFIG_ATM_LANE)
        br_fdb_test_addr_hook = br_fdb_test_addr;
 #endif
 
@@ -93,7 +108,7 @@ static void __exit br_deinit(void)
        rcu_barrier(); /* Wait for completion of call_rcu()'s */
 
        br_netfilter_fini();
-#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
+#if IS_ENABLED(CONFIG_ATM_LANE)
        br_fdb_test_addr_hook = NULL;
 #endif