net/ipv6: re-do dad when interface has IFF_NOARP flag change
authorHangbin Liu <liuhangbin@gmail.com>
Wed, 21 Nov 2018 13:52:33 +0000 (21:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Nov 2018 19:17:56 +0000 (11:17 -0800)
commit896585d48e8e9ba44cd1754fbce8537feffcc1a5
treebd98bbe64436a9df917e395b81b53feb01e301ef
parent5cd8d46ea1562be80063f53c7c6a5f40224de623
net/ipv6: re-do dad when interface has IFF_NOARP flag change

When we add a new IPv6 address, we should also join corresponding solicited-node
multicast address, unless the interface has IFF_NOARP flag, as function
addrconf_join_solict() did. But if we remove IFF_NOARP flag later, we do
not do dad and add the mcast address. So we will drop corresponding neighbour
discovery message that came from other nodes.

A typical example is after creating a ipvlan with mode l3, setting up an ipv6
address and changing the mode to l2. Then we will not be able to ping this
address as the interface doesn't join related solicited-node mcast address.

Fix it by re-doing dad when interface changed IFF_NOARP flag. Then we will add
corresponding mcast group and check if there is a duplicate address on the
network.

Reported-by: Jianlin Shi <jishi@redhat.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/addrconf.c