Commit c8507fb2 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

ipv6: flush nd cache on IFF_NOARP change

This patch is the IPv6 equivalent of commit
6c8b4e3f ("arp: flush arp cache on IFF_NOARP change")

Without it, we keep buggy neighbours in the cache, with destination
MAC address equal to our own MAC address.

Tested:
 tcpdump -i eth0 -s 0 ip6 -n -e &
 ip link set dev eth0 arp off
 ping6 remote   // sends buggy frames
 ip link set dev eth0 arp on
 ping6 remote   // should work once kernel is patched
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reported-by: default avatarMario Fanelli <mariofanelli@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b2428f94
...@@ -1650,6 +1650,7 @@ int ndisc_rcv(struct sk_buff *skb) ...@@ -1650,6 +1650,7 @@ int ndisc_rcv(struct sk_buff *skb)
static int ndisc_netdev_event(struct notifier_block *this, unsigned long event, void *ptr) static int ndisc_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
{ {
struct net_device *dev = netdev_notifier_info_to_dev(ptr); struct net_device *dev = netdev_notifier_info_to_dev(ptr);
struct netdev_notifier_change_info *change_info;
struct net *net = dev_net(dev); struct net *net = dev_net(dev);
struct inet6_dev *idev; struct inet6_dev *idev;
...@@ -1664,6 +1665,11 @@ static int ndisc_netdev_event(struct notifier_block *this, unsigned long event, ...@@ -1664,6 +1665,11 @@ static int ndisc_netdev_event(struct notifier_block *this, unsigned long event,
ndisc_send_unsol_na(dev); ndisc_send_unsol_na(dev);
in6_dev_put(idev); in6_dev_put(idev);
break; break;
case NETDEV_CHANGE:
change_info = ptr;
if (change_info->flags_changed & IFF_NOARP)
neigh_changeaddr(&nd_tbl, dev);
break;
case NETDEV_DOWN: case NETDEV_DOWN:
neigh_ifdown(&nd_tbl, dev); neigh_ifdown(&nd_tbl, dev);
fib6_run_gc(0, net, false); fib6_run_gc(0, net, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment