summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2018-10-11 23:33:49 -0400
committerDavid S. Miller <davem@davemloft.net>2018-10-12 12:47:39 -0400
commit859bd2ef1fc1110a8031b967ee656c53a6260a76 (patch)
tree96f07d4fb9cc3ec82e5b60dd1aae6976aa87ead3 /net/ipv6
parent7c6bb7d2faaf1ed7d78bafd712476e4cf2cf0d7d (diff)
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/ipv6')
-rw-r--r--net/ipv6/ndisc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 51863ada15a4..a25cfdd47c89 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1784,6 +1784,8 @@ static int ndisc_netdev_event(struct notifier_block *this, unsigned long event,
1784 change_info = ptr; 1784 change_info = ptr;
1785 if (change_info->flags_changed & IFF_NOARP) 1785 if (change_info->flags_changed & IFF_NOARP)
1786 neigh_changeaddr(&nd_tbl, dev); 1786 neigh_changeaddr(&nd_tbl, dev);
1787 if (!netif_carrier_ok(dev))
1788 neigh_carrier_down(&nd_tbl, dev);
1787 break; 1789 break;
1788 case NETDEV_DOWN: 1790 case NETDEV_DOWN:
1789 neigh_ifdown(&nd_tbl, dev); 1791 neigh_ifdown(&nd_tbl, dev);