Search Linux Wireless

[PATCH 2/3] compat: fix iteration over destination multicast addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux