diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 29b8ee4..ddeae82 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -36,6 +36,9 @@ #include #include +#include +#include + #define NEIGH_DEBUG 1 #define NEIGH_PRINTK(x...) printk(x) @@ -228,9 +231,26 @@ static void neigh_flush_dev(struct neigh_table *tbl, struct net_device *dev) void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev) { + struct in_device *in_dev; write_lock_bh(&tbl->lock); neigh_flush_dev(tbl, dev); write_unlock_bh(&tbl->lock); + + /* Send a gratuitous ARP to the neighbours to update their arp tables */ + + rcu_read_lock(); + in_dev = __in_dev_get_rcu(dev); + if (in_dev == NULL) + goto out; + if (in_dev->ifa_list) + + arp_send(ARPOP_REQUEST, ETH_P_ARP, + in_dev->ifa_list->ifa_address, + dev, + in_dev->ifa_list->ifa_address, + NULL, dev->dev_addr, NULL); +out: + rcu_read_unlock(); } int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev)