Re: [PATCH] Fix infinite loop on dev_mc_unsync()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Luis R. Rodriguez
Date: Friday, November 9, 2007 - 11:51 am

Sorry, forgot to CC David.

On Fri, Nov 09, 2007 at 10:11:35AM -0500, Luis R. Rodriguez wrote:

While reviewing net/core/dev_mcast.c I found what I think is an 
infinite loop on dev_mc_unsync(). This fixes it. We make use of
this guy on mac80211 in ieee80211_stop(). This is untested.

Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>

diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c
index 15241cf..5373c03 100644
--- a/net/core/dev_mcast.c
+++ b/net/core/dev_mcast.c
@@ -168,8 +168,10 @@ 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)
+		if (!da->da_synced) {
+			da = next;
 			continue;
+		}
 		__dev_addr_delete(&to->mc_list, &to->mc_count,
 				  da->da_addr, da->da_addrlen, 0);
 		da->da_synced = 0;
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Fix infinite loop on dev_mc_unsync(), Luis R. Rodriguez, (Fri Nov 9, 8:11 am)
Re: [PATCH] Fix infinite loop on dev_mc_unsync(), Luis R. Rodriguez, (Fri Nov 9, 11:51 am)
Re: [PATCH] Fix infinite loop on dev_mc_unsync(), Joe Perches, (Fri Nov 9, 12:07 pm)
Re: [PATCH] Fix infinite loop on dev_mc_unsync(), Luis R. Rodriguez, (Fri Nov 9, 12:21 pm)
Re: [PATCH] Fix infinite loop on dev_mc_unsync(), Patrick McHardy, (Fri Nov 9, 4:12 pm)
Re: [PATCH] Fix infinite loop on dev_mc_unsync(), Joe Perches, (Fri Nov 9, 5:08 pm)
Re: [PATCH] Fix infinite loop on dev_mc_unsync(), Patrick McHardy, (Fri Nov 9, 5:13 pm)
Re: [PATCH] Fix infinite loop on dev_mc_unsync(), David Miller, (Sat Nov 10, 10:34 pm)