ipv4 05/05: add sysctl to accept packets with local source addresses
[safe/jmp/linux-2.6] / net / core / dev_mcast.c
index b6b2a12..9e2fa39 100644 (file)
@@ -6,7 +6,7 @@
  *             Richard Underwood <richard@wuzz.demon.co.uk>
  *
  *     Stir fried together from the IP multicast and CAP patches above
- *             Alan Cox <Alan.Cox@linux.org>
+ *             Alan Cox <alan@lxorguk.ukuu.org.uk>
  *
  *     Fixes:
  *             Alan Cox        :       Update the device on a real delete
@@ -72,8 +72,7 @@ int dev_mc_delete(struct net_device *dev, void *addr, int alen, int glbl)
 {
        int err;
 
-       netif_tx_lock_bh(dev);
-       netif_addr_lock(dev);
+       netif_addr_lock_bh(dev);
        err = __dev_addr_delete(&dev->mc_list, &dev->mc_count,
                                addr, alen, glbl);
        if (!err) {
@@ -84,8 +83,7 @@ int dev_mc_delete(struct net_device *dev, void *addr, int alen, int glbl)
 
                __dev_set_rx_mode(dev);
        }
-       netif_addr_unlock(dev);
-       netif_tx_unlock_bh(dev);
+       netif_addr_unlock_bh(dev);
        return err;
 }
 
@@ -97,13 +95,11 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl)
 {
        int err;
 
-       netif_tx_lock_bh(dev);
-       netif_addr_lock(dev);
+       netif_addr_lock_bh(dev);
        err = __dev_addr_add(&dev->mc_list, &dev->mc_count, addr, alen, glbl);
        if (!err)
                __dev_set_rx_mode(dev);
-       netif_addr_unlock(dev);
-       netif_tx_unlock_bh(dev);
+       netif_addr_unlock_bh(dev);
        return err;
 }
 
@@ -123,14 +119,12 @@ int dev_mc_sync(struct net_device *to, struct net_device *from)
 {
        int err = 0;
 
-       netif_tx_lock_bh(to);
-       netif_addr_lock(to);
+       netif_addr_lock_bh(to);
        err = __dev_addr_sync(&to->mc_list, &to->mc_count,
                              &from->mc_list, &from->mc_count);
        if (!err)
                __dev_set_rx_mode(to);
-       netif_addr_unlock(to);
-       netif_tx_unlock_bh(to);
+       netif_addr_unlock_bh(to);
 
        return err;
 }
@@ -149,9 +143,7 @@ EXPORT_SYMBOL(dev_mc_sync);
  */
 void dev_mc_unsync(struct net_device *to, struct net_device *from)
 {
-       netif_tx_lock_bh(from);
-       netif_addr_lock(from);
-       netif_tx_lock_bh(to);
+       netif_addr_lock_bh(from);
        netif_addr_lock(to);
 
        __dev_addr_unsync(&to->mc_list, &to->mc_count,
@@ -159,9 +151,7 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from)
        __dev_set_rx_mode(to);
 
        netif_addr_unlock(to);
-       netif_tx_unlock_bh(to);
-       netif_addr_unlock(from);
-       netif_tx_unlock_bh(from);
+       netif_addr_unlock_bh(from);
 }
 EXPORT_SYMBOL(dev_mc_unsync);
 
@@ -174,8 +164,7 @@ static int dev_mc_seq_show(struct seq_file *seq, void *v)
        if (v == SEQ_START_TOKEN)
                return 0;
 
-       netif_tx_lock_bh(dev);
-       netif_addr_lock(dev);
+       netif_addr_lock_bh(dev);
        for (m = dev->mc_list; m; m = m->next) {
                int i;
 
@@ -187,8 +176,7 @@ static int dev_mc_seq_show(struct seq_file *seq, void *v)
 
                seq_putc(seq, '\n');
        }
-       netif_addr_unlock(dev);
-       netif_tx_unlock_bh(dev);
+       netif_addr_unlock_bh(dev);
        return 0;
 }