diff mbox

[1/1] IPv4: Send gratuitous ARP for secondary IP addresses also

Message ID 1311548970-27522-1-git-send-email-schaman@sch.bme.hu
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Zoltan, Kiss July 24, 2011, 11:09 p.m. UTC
From: Zoltan Kiss <schaman@sch.bme.hu>

If a device event generates gratuitous ARP messages, only primary
address is used for sending. This patch iterates through the whole
list. Tested with 2 IP addresses configuration on bonding interface.

Signed-off-by: Zoltan Kiss <schaman@sch.bme.hu>
---
 net/ipv4/devinet.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

Comments

David Miller July 25, 2011, 11:16 p.m. UTC | #1
From: "Zoltan, Kiss" <schaman@sch.bme.hu>
Date: Mon, 25 Jul 2011 01:09:30 +0200

> From: Zoltan Kiss <schaman@sch.bme.hu>
> 
> If a device event generates gratuitous ARP messages, only primary
> address is used for sending. This patch iterates through the whole
> list. Tested with 2 IP addresses configuration on bonding interface.
> 
> Signed-off-by: Zoltan Kiss <schaman@sch.bme.hu>

Applied.
--
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
diff mbox

Patch

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 37b3c18..bc19bd0 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1134,15 +1134,15 @@  static void inetdev_send_gratuitous_arp(struct net_device *dev,
 					struct in_device *in_dev)
 
 {
-	struct in_ifaddr *ifa = in_dev->ifa_list;
-
-	if (!ifa)
-		return;
+	struct in_ifaddr *ifa;
 
-	arp_send(ARPOP_REQUEST, ETH_P_ARP,
-		 ifa->ifa_local, dev,
-		 ifa->ifa_local, NULL,
-		 dev->dev_addr, NULL);
+	for (ifa = in_dev->ifa_list; ifa;
+	     ifa = ifa->ifa_next) {
+		arp_send(ARPOP_REQUEST, ETH_P_ARP,
+			 ifa->ifa_local, dev,
+			 ifa->ifa_local, NULL,
+			 dev->dev_addr, NULL);
+	}
 }
 
 /* Called only under RTNL semaphore */