]> Git Repo - linux.git/blobdiff - net/core/dev_mcast.c
[XFS] lose xfs_hex_dump in favor of print_hex_dump
[linux.git] / net / core / dev_mcast.c
index 63f0b33d7cedce54cfc2286aaaa71c3b539db92c..cec582563e0dcdbfcf15aa535115b62d35d29041 100644 (file)
@@ -113,32 +113,15 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl)
  *     locked by netif_tx_lock_bh.
  *
  *     This function is intended to be called from the dev->set_multicast_list
- *     function of layered software devices.
+ *     or dev->set_rx_mode function of layered software devices.
  */
 int dev_mc_sync(struct net_device *to, struct net_device *from)
 {
-       struct dev_addr_list *da, *next;
        int err = 0;
 
        netif_tx_lock_bh(to);
-       da = from->mc_list;
-       while (da != NULL) {
-               next = da->next;
-               if (!da->da_synced) {
-                       err = __dev_addr_add(&to->mc_list, &to->mc_count,
-                                            da->da_addr, da->da_addrlen, 0);
-                       if (err < 0)
-                               break;
-                       da->da_synced = 1;
-                       da->da_users++;
-               } else if (da->da_users == 1) {
-                       __dev_addr_delete(&to->mc_list, &to->mc_count,
-                                         da->da_addr, da->da_addrlen, 0);
-                       __dev_addr_delete(&from->mc_list, &from->mc_count,
-                                         da->da_addr, da->da_addrlen, 0);
-               }
-               da = next;
-       }
+       err = __dev_addr_sync(&to->mc_list, &to->mc_count,
+                             &from->mc_list, &from->mc_count);
        if (!err)
                __dev_set_rx_mode(to);
        netif_tx_unlock_bh(to);
@@ -160,23 +143,11 @@ EXPORT_SYMBOL(dev_mc_sync);
  */
 void dev_mc_unsync(struct net_device *to, struct net_device *from)
 {
-       struct dev_addr_list *da, *next;
-
        netif_tx_lock_bh(from);
        netif_tx_lock_bh(to);
 
-       da = from->mc_list;
-       while (da != NULL) {
-               next = da->next;
-               if (da->da_synced) {
-                       __dev_addr_delete(&to->mc_list, &to->mc_count,
-                                         da->da_addr, da->da_addrlen, 0);
-                       da->da_synced = 0;
-                       __dev_addr_delete(&from->mc_list, &from->mc_count,
-                                         da->da_addr, da->da_addrlen, 0);
-               }
-               da = next;
-       }
+       __dev_addr_unsync(&to->mc_list, &to->mc_count,
+                         &from->mc_list, &from->mc_count);
        __dev_set_rx_mode(to);
 
        netif_tx_unlock_bh(to);
@@ -186,6 +157,7 @@ EXPORT_SYMBOL(dev_mc_unsync);
 
 #ifdef CONFIG_PROC_FS
 static void *dev_mc_seq_start(struct seq_file *seq, loff_t *pos)
+       __acquires(dev_base_lock)
 {
        struct net *net = seq_file_net(seq);
        struct net_device *dev;
@@ -206,6 +178,7 @@ static void *dev_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 }
 
 static void dev_mc_seq_stop(struct seq_file *seq, void *v)
+       __releases(dev_base_lock)
 {
        read_unlock(&dev_base_lock);
 }
This page took 0.027835 seconds and 4 git commands to generate.