netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: Fix tentative IPv6 address due to DAD looping back
@ 2013-03-22  3:20 Meng, Jilin
  2013-03-22  3:39 ` YOSHIFUJI Hideaki
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Meng, Jilin @ 2013-03-22  3:20 UTC (permalink / raw)
  To: davem@davemloft.net, kuznet@ms2.inr.ac.ru, jmorris@namei.org,
	yoshfuji@linux-ipv6.org, kaber@trash.net
  Cc: Sun, Yinglin, Prithviraj, Lakshmanan, netdev@vger.kernel.org

we should ignore the looped-back IPv6 DAD packet to avoid configuration failure.
This occurs when a bonding interface with roundrobin mode is being configured an IPv6 address 
while the switch side isn't configured bonding/channel yet.

Signed-off-by: Jilin Meng <jilin.meng@emc.com>
Signed-off-by: Yinglin Sun <yinglin.sun@emc.com>
Signed-off-by: Lakshmanan Prithviraj <lakshmanan.prithviraj@emc.com>
---
--- linux/net/ipv6/ndisc.c.orig	2013-03-12 17:16:18.000000000 +0800
+++ linux/net/ipv6/ndisc.c	2013-03-21 10:37:06.000000000 +0800
@@ -757,6 +757,24 @@ static void ndisc_recv_ns(struct sk_buff
 
 		if (ifp->flags & (IFA_F_TENTATIVE|IFA_F_OPTIMISTIC)) {
 			if (dad) {
+				if (dev->type == ARPHRD_ETHER) {
+					const unsigned char *sadr;
+					sadr = skb_mac_header(skb);
+					if (sadr[6] == dev->dev_addr[0] &&
+					    sadr[7] == dev->dev_addr[1] &&
+					    sadr[8] == dev->dev_addr[2] &&
+					    sadr[9] == dev->dev_addr[3] &&
+					    sadr[10] == dev->dev_addr[4] &&
+					    sadr[11] == dev->dev_addr[5]) {
+					/*
+					 * looped-back to us. This occurs when
+					 * a bonding interface with roundrobin
+					 * mode is being configured while the
+					 * switch side isn't configured yet.
+					 */
+						goto out;
+				}
+
 				/*
 				 * We are colliding with another node
 				 * who is doing DAD

^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH] net: Fix tentative IPv6 address due to DAD looping back
@ 2013-04-11  1:31 Meng, Jilin
  0 siblings, 0 replies; 16+ messages in thread
From: Meng, Jilin @ 2013-04-11  1:31 UTC (permalink / raw)
  To: davem@davemloft.net, kuznet@ms2.inr.ac.ru, jmorris@namei.org,
	yoshfuji@linux-ipv6.org, kaber@trash.net
  Cc: Sun, Yinglin, Prithviraj, Lakshmanan, netdev@vger.kernel.org,
	Meng, Jilin

we should ignore the looped-back IPv6 DAD packet to avoid configuration failure.
This occurs when a bonding interface with roundrobin mode is being configured an IPv6 address while the switch side isn't configured bonding/channel yet.

Signed-off-by: Jilin Meng <jilin.meng@emc.com>
Signed-off-by: Yinglin Sun <yinglin.sun@emc.com>
Signed-off-by: Lakshmanan Prithviraj <lakshmanan.prithviraj@emc.com>
---
--- linux/net/ipv6/ndisc.c.orig	2013-03-12 17:16:18.000000000 +0800
+++ linux/net/ipv6/ndisc.c	2013-03-21 10:37:06.000000000 +0800
@@ -757,6 +757,24 @@ static void ndisc_recv_ns(struct sk_buff
 
 		if (ifp->flags & (IFA_F_TENTATIVE|IFA_F_OPTIMISTIC)) {
 			if (dad) {
+				if (dev->type == ARPHRD_ETHER) {
+					const unsigned char *sadr;
+					sadr = skb_mac_header(skb);
+					if (sadr[6] == dev->dev_addr[0] &&
+					    sadr[7] == dev->dev_addr[1] &&
+					    sadr[8] == dev->dev_addr[2] &&
+					    sadr[9] == dev->dev_addr[3] &&
+					    sadr[10] == dev->dev_addr[4] &&
+					    sadr[11] == dev->dev_addr[5]) {
+					/*
+					 * looped-back to us. This occurs when
+					 * a bonding interface with roundrobin
+					 * mode is being configured while the
+					 * switch side isn't configured yet.
+					 */
+						goto out;
+				}
+
 				/*
 				 * We are colliding with another node
 				 * who is doing DAD

^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH] net: Fix tentative IPv6 address due to DAD looping back
@ 2013-04-11  3:06 Meng, Jilin
  2013-04-11  3:14 ` David Miller
  2013-04-11 11:55 ` Hannes Frederic Sowa
  0 siblings, 2 replies; 16+ messages in thread
From: Meng, Jilin @ 2013-04-11  3:06 UTC (permalink / raw)
  To: davem@davemloft.net, kuznet@ms2.inr.ac.ru, jmorris@namei.org,
	yoshfuji@linux-ipv6.org, kaber@trash.net
  Cc: Sun, Yinglin, Prithviraj, Lakshmanan, netdev@vger.kernel.org,
	Meng, Jilin

we should ignore the looped-back IPv6 DAD packet to avoid configuration failure.
This occurs when a bonding interface with roundrobin mode is being configured an IPv6 address while the switch side isn't configured bonding/channel yet.

Signed-off-by: Jilin Meng <jilin.meng@emc.com>
Signed-off-by: Yinglin Sun <yinglin.sun@emc.com>
Signed-off-by: Lakshmanan Prithviraj <lakshmanan.prithviraj@emc.com>
---
--- linux/net/ipv6/ndisc.c.orig	2013-03-12 17:16:18.000000000 +0800
+++ linux/net/ipv6/ndisc.c	2013-04-11 09:00:45.000000000 +0800
@@ -71,6 +71,7 @@
 
 #include <linux/netfilter.h>
 #include <linux/netfilter_ipv6.h>
+#include <linux/etherdevice.h>
 
 /* Set to 3 to get tracing... */
 #define ND_DEBUG 1
@@ -757,6 +758,19 @@ static void ndisc_recv_ns(struct sk_buff
 
 		if (ifp->flags & (IFA_F_TENTATIVE|IFA_F_OPTIMISTIC)) {
 			if (dad) {
+				if (dev->type == ARPHRD_ETHER) {
+					const unsigned char *sadr;
+					sadr = skb_mac_header(skb);
+					if (ether_addr_equal_64bits(sadr + 6, dev->dev_addr))
+					/*
+					 * looped-back to us. This occurs when
+					 * a bonding interface with roundrobin
+					 * mode is being configured while the
+					 * switch side isn't configured yet.
+					 */
+						goto out;
+				}
+
 				/*
 				 * We are colliding with another node
 				 * who is doing DAD

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-04-12 20:03 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-22  3:20 [PATCH] net: Fix tentative IPv6 address due to DAD looping back Meng, Jilin
2013-03-22  3:39 ` YOSHIFUJI Hideaki
2013-04-11  3:11   ` Meng, Jilin
2013-03-22 14:37 ` Sergei Shtylyov
2013-03-22 14:47   ` Eric Dumazet
2013-04-11  3:13     ` Meng, Jilin
2013-04-11  3:16       ` David Miller
2013-04-12  7:45 ` Meng, Jilin
2013-04-12 17:15   ` David Miller
2013-04-12 17:51   ` Hannes Frederic Sowa
2013-04-12 20:03     ` Hannes Frederic Sowa
  -- strict thread matches above, loose matches on Subject: below --
2013-04-11  1:31 Meng, Jilin
2013-04-11  3:06 Meng, Jilin
2013-04-11  3:14 ` David Miller
2013-04-12  7:40   ` Meng, Jilin
2013-04-11 11:55 ` Hannes Frederic Sowa

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).