Skip to content

Commit

Permalink
ipv6: do not send RTM_DELADDR for tentative addresses
Browse files Browse the repository at this point in the history
RTM_NEWADDR notification is sent when IFA_F_TENTATIVE is cleared from
the address. So if the address is added and deleted before DAD probes
completes, the RTM_DELADDR will be sent for which there was no
RTM_NEWADDR causing asymmetry in notification. However if the same
logic is used while sending RTM_DELADDR notification, this asymmetry
can be avoided.

Signed-off-by: Mahesh Bandewar <maheshb@google.com>
CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
CC: Patrick McHardy <kaber@trash.net>
CC: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Mahesh Bandewar authored and davem330 committed Jan 6, 2017
1 parent 90028b0 commit f784ad3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -4888,6 +4888,13 @@ static void inet6_ifa_notify(int event, struct inet6_ifaddr *ifa)
struct net *net = dev_net(ifa->idev->dev);
int err = -ENOBUFS;

/* Don't send DELADDR notification for TENTATIVE address,
* since NEWADDR notification is sent only after removing
* TENTATIVE flag.
*/
if (ifa->flags & IFA_F_TENTATIVE && event == RTM_DELADDR)
return;

skb = nlmsg_new(inet6_ifaddr_msgsize(), GFP_ATOMIC);
if (!skb)
goto errout;
Expand Down

0 comments on commit f784ad3

Please sign in to comment.