[NET]: Fix infinite loop in dev_mc_unsync().
authorJoe Perches <joe@perches.com>
Sun, 11 Nov 2007 05:36:04 +0000 (21:36 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Nov 2007 05:36:04 +0000 (21:36 -0800)
From: Joe Perches <joe@perches.com>

Based upon an initial patch and report by Luis R. Rodriguez.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev_mcast.c

index ae354057d84cf5101b89126e343ce3903eed55d2..647973daca2b59f1c09d333c99b1ae3e919ddc52 100644 (file)
@@ -168,13 +168,13 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from)
        da = from->mc_list;
        while (da != NULL) {
                next = da->next;
-               if (!da->da_synced)
-                       continue;
-               __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);
+               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_set_rx_mode(to);