Skip to content

Commit

Permalink
IPv4: Send gratuitous ARP for secondary IP addresses also
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Zoltan Kiss authored and David S. Miller committed Jul 25, 2011
1 parent 32019e6 commit b76d078
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit b76d078

Please sign in to comment.