Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/netinet6 Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/3a96ee170d9c
branches:  netbsd-8
changeset: 434391:3a96ee170d9c
user:      snj <snj%NetBSD.org@localhost>
date:      Fri Nov 17 20:26:19 2017 +0000

description:
Pull up following revision(s) (requested by ozaki-r in ticket #354):
        sys/netinet6/in6_ifattach.c: revision 1.113
        sys/netinet6/nd6.c: revision 1.238
Use psref instead of pserialize because that code is sleepable
--
Use psref instead of pserialize because that code is sleepable

diffstat:

 sys/netinet6/in6_ifattach.c |  12 +++++++-----
 sys/netinet6/nd6.c          |  13 ++++++-------
 2 files changed, 13 insertions(+), 12 deletions(-)

diffs (85 lines):

diff -r 38617ae8235b -r 3a96ee170d9c sys/netinet6/in6_ifattach.c
--- a/sys/netinet6/in6_ifattach.c       Fri Nov 17 20:24:05 2017 +0000
+++ b/sys/netinet6/in6_ifattach.c       Fri Nov 17 20:26:19 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_ifattach.c,v 1.112 2017/02/23 07:57:10 ozaki-r Exp $       */
+/*     $NetBSD: in6_ifattach.c,v 1.112.6.1 2017/11/17 20:26:19 snj Exp $       */
 /*     $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $  */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.112 2017/02/23 07:57:10 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.112.6.1 2017/11/17 20:26:19 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -787,13 +787,15 @@
         */
        if (!(ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
            ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) {
-               int s = pserialize_read_enter();
-               ia = in6ifa_ifpforlinklocal(ifp, 0);
+               int bound = curlwp_bind();
+               struct psref psref;
+               ia = in6ifa_ifpforlinklocal_psref(ifp, 0, &psref);
                if (ia == NULL && in6_ifattach_linklocal(ifp, altifp) != 0) {
                        printf("%s: cannot assign link-local address\n",
                            ifp->if_xname);
                }
-               pserialize_read_exit(s);
+               ia6_release(ia, &psref);
+               curlwp_bindx(bound);
        }
 }
 
diff -r 38617ae8235b -r 3a96ee170d9c sys/netinet6/nd6.c
--- a/sys/netinet6/nd6.c        Fri Nov 17 20:24:05 2017 +0000
+++ b/sys/netinet6/nd6.c        Fri Nov 17 20:26:19 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nd6.c,v 1.232.2.3 2017/11/17 20:24:05 snj Exp $        */
+/*     $NetBSD: nd6.c,v 1.232.2.4 2017/11/17 20:26:19 snj Exp $        */
 /*     $KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $   */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.232.2.3 2017/11/17 20:24:05 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.232.2.4 2017/11/17 20:26:19 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1446,7 +1446,7 @@
 
        switch (req) {
        case RTM_ADD: {
-               int s;
+               struct psref psref;
 
                RT_DPRINTF("rt_getkey(rt) = %p\n", rt_getkey(rt));
                /*
@@ -1554,9 +1554,8 @@
                 * check if rt_getkey(rt) is an address assigned
                 * to the interface.
                 */
-               s = pserialize_read_enter();
-               ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp,
-                   &satocsin6(rt_getkey(rt))->sin6_addr);
+               ifa = (struct ifaddr *)in6ifa_ifpwithaddr_psref(ifp,
+                   &satocsin6(rt_getkey(rt))->sin6_addr, &psref);
                if (ifa != NULL) {
                        if (nd6_useloopback) {
                                rt->rt_ifp = lo0ifp;    /* XXX */
@@ -1593,7 +1592,7 @@
                        }
                }
        out:
-               pserialize_read_exit(s);
+               ifa_release(ifa, &psref);
                /*
                 * If we have too many cache entries, initiate immediate
                 * purging for some entries.



Home | Main Index | Thread Index | Old Index