Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src Pull up following revision(s) (requested by roy in ticket...



details:   https://anonhg.NetBSD.org/src/rev/744b9f22b1b2
branches:  netbsd-7
changeset: 798468:744b9f22b1b2
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Oct 27 13:42:37 2014 +0000

description:
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.

diffstat:

 sbin/ifconfig/af_inet6.c |   7 +++----
 sbin/ifconfig/ifconfig.8 |  10 ++--------
 sys/netinet6/in6.c       |  12 ++++++++----
 3 files changed, 13 insertions(+), 16 deletions(-)

diffs (121 lines):

diff -r de3a61a99845 -r 744b9f22b1b2 sbin/ifconfig/af_inet6.c
--- a/sbin/ifconfig/af_inet6.c  Mon Oct 27 13:39:11 2014 +0000
+++ b/sbin/ifconfig/af_inet6.c  Mon Oct 27 13:42:37 2014 +0000
@@ -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 const struct kwinst ia6flagskw[] = {
          IFKW("anycast",       IN6_IFF_ANYCAST)
-       , IFKW("tentative",     IN6_IFF_TENTATIVE)
        , IFKW("deprecated",    IN6_IFF_DEPRECATED)
 };
 
@@ -476,7 +475,7 @@
 {
        fprintf(stderr,
            "\t[ anycast | -anycast ] [ deprecated | -deprecated ]\n"
-           "\t[ tentative | -tentative ] [ pltime n ] [ vltime n ] "
+           "\t[ pltime n ] [ vltime n ] "
            "[ eui64 ]\n");
 }
 
diff -r de3a61a99845 -r 744b9f22b1b2 sbin/ifconfig/ifconfig.8
--- a/sbin/ifconfig/ifconfig.8  Mon Oct 27 13:39:11 2014 +0000
+++ b/sbin/ifconfig/ifconfig.8  Mon Oct 27 13:42:37 2014 +0000
@@ -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 @@
 .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
diff -r de3a61a99845 -r 744b9f22b1b2 sys/netinet6/in6.c
--- a/sys/netinet6/in6.c        Mon Oct 27 13:39:11 2014 +0000
+++ b/sys/netinet6/in6.c        Mon Oct 27 13:42:37 2014 +0000
@@ -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 @@
                /* 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 @@
        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 @@
 
        /*
         * 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 @@
        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;
 
        /*



Home | Main Index | Thread Index | Old Index