Module Name:    src
Committed By:   martin
Date:           Mon Oct 27 13:42:37 UTC 2014

Modified Files:
        src/sbin/ifconfig [netbsd-7]: af_inet6.c ifconfig.8
        src/sys/netinet6 [netbsd-7]: in6.c

Log Message:
Pull up following revision(s) (requested by roy in ticket #160):
        sbin/ifconfig/af_inet6.c: revision 1.30
        sbin/ifconfig/ifconfig.8: revision 1.109
        sys/netinet6/in6.c: revision 1.177
Remove the ability for userland to toggle IN6_IFF_TENTATIVE.
Preserve IN6_IFF_TENTATIVE when updating address flags.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.29.4.1 src/sbin/ifconfig/af_inet6.c
cvs rdiff -u -r1.106.4.1 -r1.106.4.2 src/sbin/ifconfig/ifconfig.8
cvs rdiff -u -r1.174 -r1.174.2.1 src/sys/netinet6/in6.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/ifconfig/af_inet6.c
diff -u src/sbin/ifconfig/af_inet6.c:1.29 src/sbin/ifconfig/af_inet6.c:1.29.4.1
--- src/sbin/ifconfig/af_inet6.c:1.29	Sat Oct 19 15:50:26 2013
+++ src/sbin/ifconfig/af_inet6.c	Mon Oct 27 13:42:37 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: af_inet6.c,v 1.29 2013/10/19 15:50:26 christos Exp $	*/
+/*	$NetBSD: af_inet6.c,v 1.29.4.1 2014/10/27 13:42:37 martin Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: af_inet6.c,v 1.29 2013/10/19 15:50:26 christos Exp $");
+__RCSID("$NetBSD: af_inet6.c,v 1.29.4.1 2014/10/27 13:42:37 martin Exp $");
 #endif /* not lint */
 
 #include <sys/param.h> 
@@ -78,7 +78,6 @@ static cmdloop_branch_t branch[2];
 
 static const struct kwinst ia6flagskw[] = {
 	  IFKW("anycast",	IN6_IFF_ANYCAST)
-	, IFKW("tentative",	IN6_IFF_TENTATIVE)
 	, IFKW("deprecated",	IN6_IFF_DEPRECATED)
 };
 
@@ -476,7 +475,7 @@ in6_usage(prop_dictionary_t env)
 {
 	fprintf(stderr,
 	    "\t[ anycast | -anycast ] [ deprecated | -deprecated ]\n"
-	    "\t[ tentative | -tentative ] [ pltime n ] [ vltime n ] "
+	    "\t[ pltime n ] [ vltime n ] "
 	    "[ eui64 ]\n");
 }
 

Index: src/sbin/ifconfig/ifconfig.8
diff -u src/sbin/ifconfig/ifconfig.8:1.106.4.1 src/sbin/ifconfig/ifconfig.8:1.106.4.2
--- src/sbin/ifconfig/ifconfig.8:1.106.4.1	Mon Sep 22 10:44:37 2014
+++ src/sbin/ifconfig/ifconfig.8	Mon Oct 27 13:42:37 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ifconfig.8,v 1.106.4.1 2014/09/22 10:44:37 martin Exp $
+.\"	$NetBSD: ifconfig.8,v 1.106.4.2 2014/10/27 13:42:37 martin Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"     @(#)ifconfig.8	8.4 (Berkeley) 6/1/94
 .\"
-.Dd September 15, 2014
+.Dd October 12, 2014
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -548,12 +548,6 @@ Set the IPv6 deprecated address bit.
 .It Fl deprecated
 .Pq inet6 only
 Clear the IPv6 deprecated address bit.
-.It Cm tentative
-.Pq inet6 only
-Set the IPv6 tentative address bit.
-.It Fl tentative
-.Pq inet6 only
-Clear the IPv6 tentative address bit.
 .It Cm eui64
 .Pq inet6 only
 Fill interface index

Index: src/sys/netinet6/in6.c
diff -u src/sys/netinet6/in6.c:1.174 src/sys/netinet6/in6.c:1.174.2.1
--- src/sys/netinet6/in6.c:1.174	Tue Jul  1 23:01:54 2014
+++ src/sys/netinet6/in6.c	Mon Oct 27 13:42:37 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.c,v 1.174 2014/07/01 23:01:54 justin Exp $	*/
+/*	$NetBSD: in6.c,v 1.174.2.1 2014/10/27 13:42:37 martin Exp $	*/
 /*	$KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.174 2014/07/01 23:01:54 justin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.174.2.1 2014/10/27 13:42:37 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_compat_netbsd.h"
@@ -649,6 +649,7 @@ in6_control1(struct socket *so, u_long c
 		/* reject read-only flags */
 		if ((ifra->ifra_flags & IN6_IFF_DUPLICATED) != 0 ||
 		    (ifra->ifra_flags & IN6_IFF_DETACHED) != 0 ||
+		    (ifra->ifra_flags & IN6_IFF_TENTATIVE) != 0 ||
 		    (ifra->ifra_flags & IN6_IFF_NODAD) != 0 ||
 		    (ifra->ifra_flags & IN6_IFF_AUTOCONF) != 0) {
 			return EINVAL;
@@ -834,7 +835,7 @@ in6_update_ifa1(struct ifnet *ifp, struc
 	struct in6_multi_mship *imm;
 	struct in6_multi *in6m_sol;
 	struct rtentry *rt;
-	int dad_delay;
+	int dad_delay, was_tentative;
 
 	in6m_sol = NULL;
 
@@ -1063,7 +1064,10 @@ in6_update_ifa1(struct ifnet *ifp, struc
 
 	/*
 	 * configure address flags.
+	 * We need to preserve tentative state so DAD works if
+	 * something adds the same address before DAD finishes.
 	 */
+	was_tentative = ia->ia6_flags & (IN6_IFF_TENTATIVE|IN6_IFF_DUPLICATED);
 	ia->ia6_flags = ifra->ifra_flags;
 
 	/*
@@ -1075,7 +1079,7 @@ in6_update_ifa1(struct ifnet *ifp, struc
 	if (ifp->if_link_state == LINK_STATE_DOWN) {
 		ia->ia6_flags |= IN6_IFF_DETACHED;
 		ia->ia6_flags &= ~IN6_IFF_TENTATIVE;
-	} else if (hostIsNew && in6if_do_dad(ifp))
+	} else if ((hostIsNew || was_tentative) && in6if_do_dad(ifp))
 		ia->ia6_flags |= IN6_IFF_TENTATIVE;
 
 	/*

Reply via email to