diff options
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r-- | sys/netinet6/in6.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 1c5ec065aa5..338adcbc50a 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.219 2017/11/23 13:32:25 mpi Exp $ */ +/* $OpenBSD: in6.c,v 1.220 2018/04/24 10:46:25 florian Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -420,15 +420,15 @@ in6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, int privileged) break; } + /* Perform DAD, if needed. */ + if (ia6->ia6_flags & IN6_IFF_TENTATIVE) + nd6_dad_start(&ia6->ia_ifa); + if (!newifaddr) { dohooks(ifp->if_addrhooks, 0); break; } - /* Perform DAD, if needed. */ - if (ia6->ia6_flags & IN6_IFF_TENTATIVE) - nd6_dad_start(&ia6->ia_ifa); - plen = in6_mask2len(&ia6->ia_prefixmask.sin6_addr, NULL); if ((ifp->if_flags & IFF_LOOPBACK) || plen == 128) { dohooks(ifp->if_addrhooks, 0); @@ -655,6 +655,9 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra, if ((error = in6_ifinit(ifp, ia6, hostIsNew)) != 0) goto unlink; + /* re-run DAD */ + if (ia6->ia6_flags & (IN6_IFF_TENTATIVE|IN6_IFF_DUPLICATED)) + ifra->ifra_flags |= IN6_IFF_TENTATIVE; /* * configure address flags. */ |