From patchwork Wed Aug 3 05:03:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Roskin X-Patchwork-Id: 1030482 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7353ir1022322 for ; Wed, 3 Aug 2011 05:03:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753988Ab1HCFDm (ORCPT ); Wed, 3 Aug 2011 01:03:42 -0400 Received: from c60.cesmail.net ([216.154.195.49]:26840 "EHLO c60.cesmail.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753834Ab1HCFDm (ORCPT ); Wed, 3 Aug 2011 01:03:42 -0400 Received: from unknown (HELO smtprelay1.cesmail.net) ([192.168.1.111]) by c60.cesmail.net with ESMTP; 03 Aug 2011 01:03:41 -0400 Received: from mj.roinet.com (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay1.cesmail.net (Postfix) with ESMTPSA id 9522934C9A; Wed, 3 Aug 2011 01:08:55 -0400 (EDT) Subject: [PATCH 2/3] compat: fix iteration over destination multicast addresses To: "Luis R. Rodriguez" , linux-wireless@vger.kernel.org From: Pavel Roskin Date: Wed, 03 Aug 2011 01:03:39 -0400 Message-ID: <20110803050339.10364.48100.stgit@mj.roinet.com> In-Reply-To: <20110803050333.10364.78012.stgit@mj.roinet.com> References: <20110803050333.10364.78012.stgit@mj.roinet.com> User-Agent: StGit/0.15-111-g507b MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 03 Aug 2011 05:03:44 +0000 (UTC) Fix dev_mc_sync() and dev_mc_unsync() in compat-2.6.23.c. When looking for synchronized addresses, put "break" inside the above "if" to break the loop only if there is a match. Otherwise, advance da_to to the next address. Signed-off-by: Pavel Roskin --- compat/compat-2.6.23.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/compat/compat-2.6.23.c b/compat/compat-2.6.23.c index d31cfb4..365f941 100644 --- a/compat/compat-2.6.23.c +++ b/compat/compat-2.6.23.c @@ -104,9 +104,11 @@ int dev_mc_sync(struct net_device *to, struct net_device *from) /* 2.6.22 does not have da->da_synced so lets take the long route */ while (da_to != NULL) { if (memcmp(da_to->da_addr, da->da_addr, da_to->da_addrlen) == 0 && - da->da_addrlen == da_to->da_addrlen) + da->da_addrlen == da_to->da_addrlen) { synced = 1; break; + } + da_to = da_to->next; } if (!synced) { err = __dev_addr_add(&to->mc_list, &to->mc_count, @@ -160,9 +162,11 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from) /* 2.6.22 does not have da->da_synced so lets take the long route */ while (da_to != NULL) { if (memcmp(da_to->da_addr, da->da_addr, da_to->da_addrlen) == 0 && - da->da_addrlen == da_to->da_addrlen) + da->da_addrlen == da_to->da_addrlen) { synced = true; break; + } + da_to = da_to->next; } if (!synced) { da = next;