-/* $OpenBSD: icmp6.c,v 1.185 2016/03/29 11:57:51 chl Exp $ */
+/* $OpenBSD: icmp6.c,v 1.186 2016/07/05 10:17:14 mpi Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
/*
* If the incoming packet was addressed directly to us (i.e. unicast),
* use dst as the src for the reply.
- * The IN6_IFF_NOTREADY case would be VERY rare, but is possible
- * (for example) when we encounter an error while forwarding procedure
- * destined to a duplicated address of ours.
+ * The IN6_IFF_TENTATIVE|IN6_IFF_DUPLICATED case would be VERY rare,
+ * but is possible (for example) when we encounter an error while
+ * forwarding procedure destined to a duplicated address of ours.
*/
TAILQ_FOREACH(ia6, &in6_ifaddr, ia_list)
if (IN6_ARE_ADDR_EQUAL(&t, &ia6->ia_addr.sin6_addr) &&
- (ia6->ia6_flags & (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY)) == 0) {
+ (ia6->ia6_flags & (IN6_IFF_ANYCAST|IN6_IFF_TENTATIVE|
+ IN6_IFF_DUPLICATED)) == 0) {
src = &t;
break;
}
{
/* get ip6 linklocal address for ifp(my outgoing interface). */
struct in6_ifaddr *ia6;
- if ((ia6 = in6ifa_ifpforlinklocal(ifp,
- IN6_IFF_NOTREADY|
- IN6_IFF_ANYCAST)) == NULL)
+ if ((ia6 = in6ifa_ifpforlinklocal(ifp, IN6_IFF_TENTATIVE|
+ IN6_IFF_DUPLICATED|IN6_IFF_ANYCAST)) == NULL)
goto fail;
ifp_ll6 = &ia6->ia_addr.sin6_addr;
}
-/* $OpenBSD: in6.c,v 1.187 2016/06/13 10:34:40 mpi Exp $ */
+/* $OpenBSD: in6.c,v 1.188 2016/07/05 10:17:14 mpi Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
* Don't use an address before completing DAD
* nor a duplicated address.
*/
- if (ifatoia6(ifa)->ia6_flags & IN6_IFF_NOTREADY)
+ if (ifatoia6(ifa)->ia6_flags &
+ (IN6_IFF_TENTATIVE|IN6_IFF_DUPLICATED))
continue;
/* XXX: is there any case to allow anycasts? */
-/* $OpenBSD: in6_pcb.c,v 1.92 2016/04/11 21:24:29 vgross Exp $ */
+/* $OpenBSD: in6_pcb.c,v 1.93 2016/07/05 10:17:14 mpi Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* flag to control the bind(2) behavior against
* deprecated addresses (default: forbid bind(2)).
*/
- if (ifa &&
- ifatoia6(ifa)->ia6_flags &
- (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY|IN6_IFF_DETACHED))
+ if (ifa && ifatoia6(ifa)->ia6_flags & (IN6_IFF_ANYCAST|
+ IN6_IFF_TENTATIVE|IN6_IFF_DUPLICATED|IN6_IFF_DETACHED))
return (EADDRNOTAVAIL);
}
if (lport) {
-/* $OpenBSD: in6_src.c,v 1.75 2016/07/05 09:17:10 mpi Exp $ */
+/* $OpenBSD: in6_src.c,v 1.76 2016/07/05 10:17:14 mpi Exp $ */
/* $KAME: in6_src.c,v 1.36 2001/02/06 04:08:17 itojun Exp $ */
/*
if_put(ifp); /* put reference from in6_selectif */
ia6 = ifatoia6(ifa_ifwithaddr(sin6tosa(&sa6), rtableid));
- if (ia6 == NULL ||
- (ia6->ia6_flags & (IN6_IFF_ANYCAST | IN6_IFF_NOTREADY)))
+ if (ia6 == NULL || (ia6->ia6_flags &
+ (IN6_IFF_ANYCAST|IN6_IFF_TENTATIVE|IN6_IFF_DUPLICATED)))
return (EADDRNOTAVAIL);
pi->ipi6_addr = sa6.sin6_addr; /* XXX: this overrides pi */
-/* $OpenBSD: in6_var.h,v 1.63 2016/06/13 10:34:40 mpi Exp $ */
+/* $OpenBSD: in6_var.h,v 1.64 2016/07/05 10:17:14 mpi Exp $ */
/* $KAME: in6_var.h,v 1.55 2001/02/16 12:49:45 itojun Exp $ */
/*
#define IN6_IFF_AUTOCONF 0x40 /* autoconfigurable address. */
#define IN6_IFF_PRIVACY 0x80 /* RFC 4941 temporary address */
-/* do not input/output */
-#define IN6_IFF_NOTREADY (IN6_IFF_TENTATIVE|IN6_IFF_DUPLICATED)
-
#ifdef _KERNEL
#define IN6_ARE_SCOPE_CMP(a,b) ((a)-(b))
#define IN6_ARE_SCOPE_EQUAL(a,b) ((a)==(b))
-/* $OpenBSD: ip6_input.c,v 1.160 2016/05/19 11:34:40 jca Exp $ */
+/* $OpenBSD: ip6_input.c,v 1.161 2016/07/05 10:17:14 mpi Exp $ */
/* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */
/*
* packets to a tentative, duplicated, or somehow invalid
* address must not be accepted.
*/
- if (!(ia6->ia6_flags & IN6_IFF_NOTREADY)) {
- /* this address is ready */
- ours = 1;
- goto hbhcheck;
- } else {
+ if ((ia6->ia6_flags & (IN6_IFF_TENTATIVE|IN6_IFF_DUPLICATED))) {
char src[INET6_ADDRSTRLEN], dst[INET6_ADDRSTRLEN];
inet_ntop(AF_INET6, &ip6->ip6_src, src, sizeof(src));
src, dst));
goto bad;
+ } else {
+ /* this address is ready */
+ ours = 1;
+ goto hbhcheck;
}
}
-/* $OpenBSD: mld6.c,v 1.47 2016/03/07 18:44:00 naddy Exp $ */
+/* $OpenBSD: mld6.c,v 1.48 2016/07/05 10:17:14 mpi Exp $ */
/* $KAME: mld6.c,v 1.26 2001/02/16 14:50:35 itojun Exp $ */
/*
* We do not reject tentative addresses for MLD report to deal with
* the case where we first join a link-local address.
*/
- ignflags = (IN6_IFF_NOTREADY|IN6_IFF_ANYCAST) & ~IN6_IFF_TENTATIVE;
+ ignflags = IN6_IFF_DUPLICATED|IN6_IFF_ANYCAST;
if ((ia6 = in6ifa_ifpforlinklocal(ifp, ignflags)) == NULL) {
if_put(ifp);
return;
-/* $OpenBSD: nd6_nbr.c,v 1.104 2016/06/15 11:49:35 mpi Exp $ */
+/* $OpenBSD: nd6_nbr.c,v 1.105 2016/07/05 10:17:14 mpi Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/*
/*
* proxy NDP for single entry
*/
- ifa = &in6ifa_ifpforlinklocal(ifp,
- IN6_IFF_NOTREADY | IN6_IFF_ANYCAST)->ia_ifa;
+ ifa = &in6ifa_ifpforlinklocal(ifp, IN6_IFF_TENTATIVE|
+ IN6_IFF_DUPLICATED|IN6_IFF_ANYCAST)->ia_ifa;
if (ifa) {
proxy = 1;
proxydl = satosdl(rt->rt_gateway);
-/* $OpenBSD: nd6_rtr.c,v 1.139 2016/05/02 22:15:49 jmatthew Exp $ */
+/* $OpenBSD: nd6_rtr.c,v 1.140 2016/07/05 10:17:14 mpi Exp $ */
/* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */
/*
else
return NULL;
-#if 0 /* don't care link local addr state, and always do DAD */
- /* if link-local address is not eligible, do not autoconfigure. */
- if (ifatoia6(ifa)->ia6_flags & IN6_IFF_NOTREADY) {
- printf("in6_ifadd: link-local address not ready\n");
- return NULL;
- }
-#endif
-
/* prefixlen + ifidlen must be equal to 128 */
plen0 = in6_mask2len(&ia6->ia_prefixmask.sin6_addr, NULL);
if (prefixlen != plen0) {
-/* $OpenBSD: raw_ip6.c,v 1.90 2016/04/11 15:28:03 vgross Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.91 2016/07/05 10:17:14 mpi Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
break;
}
if (ifa && ifatoia6(ifa)->ia6_flags &
- (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY|
+ (IN6_IFF_ANYCAST|IN6_IFF_TENTATIVE|IN6_IFF_DUPLICATED|
IN6_IFF_DETACHED|IN6_IFF_DEPRECATED)) {
error = EADDRNOTAVAIL;
break;