Skip to content

Commit 66eb9f8

Browse files
Mahesh Bandewardavem330
authored andcommitted
ipv6: avoid dad-failures for addresses with NODAD
Every address gets added with TENTATIVE flag even for the addresses with IFA_F_NODAD flag and dad-work is scheduled for them. During this DAD process we realize it's an address with NODAD and complete the process without sending any probe. However the TENTATIVE flags stays on the address for sometime enough to cause misinterpretation when we receive a NS. While processing NS, if the address has TENTATIVE flag, we mark it DADFAILED and endup with an address that was originally configured as NODAD with DADFAILED. We can't avoid scheduling dad_work for addresses with NODAD but we can avoid adding TENTATIVE flag to avoid this racy situation. Signed-off-by: Mahesh Bandewar <[email protected]> Acked-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent aa4ad88 commit 66eb9f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/ipv6/addrconf.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,10 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr,
10221022
INIT_HLIST_NODE(&ifa->addr_lst);
10231023
ifa->scope = scope;
10241024
ifa->prefix_len = pfxlen;
1025-
ifa->flags = flags | IFA_F_TENTATIVE;
1025+
ifa->flags = flags;
1026+
/* No need to add the TENTATIVE flag for addresses with NODAD */
1027+
if (!(flags & IFA_F_NODAD))
1028+
ifa->flags |= IFA_F_TENTATIVE;
10261029
ifa->valid_lft = valid_lft;
10271030
ifa->prefered_lft = prefered_lft;
10281031
ifa->cstamp = ifa->tstamp = jiffies;

0 commit comments

Comments
 (0)