summaryrefslogtreecommitdiffstats
path: root/net/ipv4/arp.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2018-10-12 05:33:49 +0200
committerDavid S. Miller <davem@davemloft.net>2018-10-12 18:47:39 +0200
commit859bd2ef1fc1110a8031b967ee656c53a6260a76 (patch)
tree96f07d4fb9cc3ec82e5b60dd1aae6976aa87ead3 /net/ipv4/arp.c
parentnet/ipv6: Add knob to skip DELROUTE message on device down (diff)
downloadlinux-859bd2ef1fc1110a8031b967ee656c53a6260a76.tar.xz
linux-859bd2ef1fc1110a8031b967ee656c53a6260a76.zip
net: Evict neighbor entries on carrier down
When a link's carrier goes down it could be a sign of the port changing networks. If the new network has overlapping addresses with the old one, then the kernel will continue trying to use neighbor entries established based on the old network until the entries finally age out - meaning a potentially long delay with communications not working. This patch evicts neighbor entries on carrier down with the exception of those marked permanent. Permanent entries are managed by userspace (either an admin or a routing daemon such as FRR). Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/arp.c')
-rw-r--r--net/ipv4/arp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index e90c89ef8c08..850a6f13a082 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1255,6 +1255,8 @@ static int arp_netdev_event(struct notifier_block *this, unsigned long event,
change_info = ptr;
if (change_info->flags_changed & IFF_NOARP)
neigh_changeaddr(&arp_tbl, dev);
+ if (!netif_carrier_ok(dev))
+ neigh_carrier_down(&arp_tbl, dev);
break;
default:
break;