linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: "Luis R. Rodriguez" <mcgrof@gmail.com>, linux-wireless@vger.kernel.org
Subject: [PATCH 2/3] compat: fix iteration over destination multicast addresses
Date: Wed, 03 Aug 2011 01:03:39 -0400	[thread overview]
Message-ID: <20110803050339.10364.48100.stgit@mj.roinet.com> (raw)
In-Reply-To: <20110803050333.10364.78012.stgit@mj.roinet.com>

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 <proski@gnu.org>
---
 compat/compat-2.6.23.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

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;

  reply	other threads:[~2011-08-03  5:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03  5:03 [PATCH 1/3] compat: remove stray #endif from compat-2.6.23.c Pavel Roskin
2011-08-03  5:03 ` Pavel Roskin [this message]
2011-08-03  5:03 ` [PATCH 3/3] compat: don't define genl_register_mc_group() for Linux 2.6.22 and older Pavel Roskin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110803050339.10364.48100.stgit@mj.roinet.com \
    --to=proski@gnu.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mcgrof@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).