diff options
author | Zoltan Kiss <schaman@sch.bme.hu> | 2011-07-24 13:09:30 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-15 18:31:38 -0700 |
commit | 711ae7c7a810eb8bc92cac46041c996eb66dbd54 (patch) | |
tree | 981893e0b5c74291954deddd75ca505da52dafe2 | |
parent | 956c35400bfa51940de15ff7c31b7bba298f1dfe (diff) |
IPv4: Send gratuitous ARP for secondary IP addresses also
[ Upstream commit b76d0789c92a816a5539dc14232a700b8d62a53a ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | net/ipv4/devinet.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 0d4a184af16..4155abca261 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 */ |