Module Name: src Committed By: ozaki-r Date: Fri Nov 10 07:27:57 UTC 2017
Modified Files: src/sys/netinet6: in6_ifattach.c Log Message: Use psref instead of pserialize because that code is sleepable To generate a diff of this commit: cvs rdiff -u -r1.112 -r1.113 src/sys/netinet6/in6_ifattach.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/netinet6/in6_ifattach.c diff -u src/sys/netinet6/in6_ifattach.c:1.112 src/sys/netinet6/in6_ifattach.c:1.113 --- src/sys/netinet6/in6_ifattach.c:1.112 Thu Feb 23 07:57:10 2017 +++ src/sys/netinet6/in6_ifattach.c Fri Nov 10 07:27:57 2017 @@ -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.113 2017/11/10 07:27:57 ozaki-r 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.113 2017/11/10 07:27:57 ozaki-r Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -787,13 +787,15 @@ in6_ifattach(struct ifnet *ifp, struct i */ 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); } }