summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorozaki-r <ozaki-r@NetBSD.org>2016-06-16 02:38:40 +0000
committerozaki-r <ozaki-r@NetBSD.org>2016-06-16 02:38:40 +0000
commit41c2e7d1cb5cc7b95dee4c56ba98ed974ee4deb5 (patch)
treec6a9865e3d02d1c169b9cb05884fc9560f4cef55 /sys
parent1a7bb65c12b2d37002f3e625910326dc3deb45ff (diff)
Use curlwp_bind and curlwp_bindx instead of open-coding LP_BOUND
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/common/uipc_syscalls_40.c12
-rw-r--r--sys/compat/linux/common/linux_socket.c12
-rw-r--r--sys/compat/linux32/common/linux32_socket.c12
-rw-r--r--sys/dist/pf/net/pf_if.c16
-rw-r--r--sys/kern/uipc_mbuf.c9
-rw-r--r--sys/net/if.c31
-rw-r--r--sys/net/rtsock.c11
-rw-r--r--sys/netinet/ip_carp.c9
-rw-r--r--sys/netinet6/raw_ip6.c10
-rw-r--r--sys/rump/net/lib/libshmif/if_shmem.c10
-rw-r--r--sys/rump/net/lib/libvirtif/if_virt.c10
11 files changed, 68 insertions, 74 deletions
diff --git a/sys/compat/common/uipc_syscalls_40.c b/sys/compat/common/uipc_syscalls_40.c
index 6bf7838aedd..3b5ba38bfc8 100644
--- a/sys/compat/common/uipc_syscalls_40.c
+++ b/sys/compat/common/uipc_syscalls_40.c
@@ -1,9 +1,9 @@
-/* $NetBSD: uipc_syscalls_40.c,v 1.9 2016/05/12 02:24:16 ozaki-r Exp $ */
+/* $NetBSD: uipc_syscalls_40.c,v 1.10 2016/06/16 02:38:40 ozaki-r Exp $ */
/* written by Pavel Cahyna, 2006. Public domain. */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.9 2016/05/12 02:24:16 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.10 2016/06/16 02:38:40 ozaki-r Exp $");
/*
* System call interface to the socket abstraction.
@@ -40,7 +40,7 @@ compat_ifconf(u_long cmd, void *data)
const int sz = (int)sizeof(ifr);
const bool docopy = ifc->ifc_req != NULL;
int s;
- int bound = curlwp->l_pflag & LP_BOUND;
+ int bound;
struct psref psref;
if (docopy) {
@@ -48,7 +48,7 @@ compat_ifconf(u_long cmd, void *data)
ifrp = ifc->ifc_req;
}
- curlwp->l_pflag |= LP_BOUND;
+ bound = curlwp_bind();
s = pserialize_read_enter();
IFNET_READER_FOREACH(ifp) {
psref_acquire(&psref, &ifp->if_psref, ifnet_psref_class);
@@ -121,7 +121,7 @@ compat_ifconf(u_long cmd, void *data)
psref_release(&psref, &ifp->if_psref, ifnet_psref_class);
}
pserialize_read_exit(s);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
if (docopy)
ifc->ifc_len -= space;
@@ -131,7 +131,7 @@ compat_ifconf(u_long cmd, void *data)
release_exit:
psref_release(&psref, &ifp->if_psref, ifnet_psref_class);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
return error;
}
#endif
diff --git a/sys/compat/linux/common/linux_socket.c b/sys/compat/linux/common/linux_socket.c
index ad62a60e6cc..885dddd1cf8 100644
--- a/sys/compat/linux/common/linux_socket.c
+++ b/sys/compat/linux/common/linux_socket.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_socket.c,v 1.128 2016/06/15 06:01:21 ozaki-r Exp $ */
+/* $NetBSD: linux_socket.c,v 1.129 2016/06/16 02:38:40 ozaki-r Exp $ */
/*-
* Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.128 2016/06/15 06:01:21 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.129 2016/06/16 02:38:40 ozaki-r Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -1124,7 +1124,7 @@ linux_getifconf(struct lwp *l, register_t *retval, void *data)
const int sz = (int)sizeof(ifr);
bool docopy;
int s;
- int bound = curlwp->l_pflag & LP_BOUND;
+ int bound;
struct psref psref;
error = copyin(data, &ifc, sizeof(ifc));
@@ -1137,7 +1137,7 @@ linux_getifconf(struct lwp *l, register_t *retval, void *data)
ifrp = ifc.ifc_req;
}
- curlwp->l_pflag |= LP_BOUND;
+ bound = curlwp_bind();
s = pserialize_read_enter();
IFNET_READER_FOREACH(ifp) {
psref_acquire(&psref, &ifp->if_psref, ifnet_psref_class);
@@ -1172,7 +1172,7 @@ linux_getifconf(struct lwp *l, register_t *retval, void *data)
psref_release(&psref, &ifp->if_psref, ifnet_psref_class);
}
pserialize_read_exit(s);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
if (docopy)
ifc.ifc_len -= space;
@@ -1183,7 +1183,7 @@ linux_getifconf(struct lwp *l, register_t *retval, void *data)
release_exit:
psref_release(&psref, &ifp->if_psref, ifnet_psref_class);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
return error;
}
diff --git a/sys/compat/linux32/common/linux32_socket.c b/sys/compat/linux32/common/linux32_socket.c
index e5b7e8f7e6a..fba2cb24dde 100644
--- a/sys/compat/linux32/common/linux32_socket.c
+++ b/sys/compat/linux32/common/linux32_socket.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_socket.c,v 1.22 2016/06/15 06:01:21 ozaki-r Exp $ */
+/* $NetBSD: linux32_socket.c,v 1.23 2016/06/16 02:38:40 ozaki-r Exp $ */
/*-
* Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.22 2016/06/15 06:01:21 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.23 2016/06/16 02:38:40 ozaki-r Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -425,7 +425,7 @@ linux32_getifconf(struct lwp *l, register_t *retval, void *data)
const int sz = (int)sizeof(ifr);
bool docopy;
int s;
- int bound = curlwp->l_pflag & LP_BOUND;
+ int bound;
struct psref psref;
error = copyin(data, &ifc, sizeof(ifc));
@@ -438,7 +438,7 @@ linux32_getifconf(struct lwp *l, register_t *retval, void *data)
ifrp = NETBSD32PTR64(ifc.ifc_req);
}
- curlwp->l_pflag |= LP_BOUND;
+ bound = curlwp_bind();
s = pserialize_read_enter();
IFNET_READER_FOREACH(ifp) {
psref_acquire(&psref, &ifp->if_psref, ifnet_psref_class);
@@ -473,7 +473,7 @@ linux32_getifconf(struct lwp *l, register_t *retval, void *data)
psref_release(&psref, &ifp->if_psref, ifnet_psref_class);
}
pserialize_read_exit(s);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
if (docopy)
ifc.ifc_len -= space;
@@ -484,7 +484,7 @@ linux32_getifconf(struct lwp *l, register_t *retval, void *data)
release_exit:
psref_release(&psref, &ifp->if_psref, ifnet_psref_class);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
return error;
}
diff --git a/sys/dist/pf/net/pf_if.c b/sys/dist/pf/net/pf_if.c
index 4aa6d8041ea..3ded67d61f3 100644
--- a/sys/dist/pf/net/pf_if.c
+++ b/sys/dist/pf/net/pf_if.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pf_if.c,v 1.27 2016/05/12 02:24:16 ozaki-r Exp $ */
+/* $NetBSD: pf_if.c,v 1.28 2016/06/16 02:38:40 ozaki-r Exp $ */
/* $OpenBSD: pf_if.c,v 1.47 2007/07/13 09:17:48 markus Exp $ */
/*
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pf_if.c,v 1.27 2016/05/12 02:24:16 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf_if.c,v 1.28 2016/06/16 02:38:40 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -101,7 +101,7 @@ void
pfi_initialize(void)
{
int s;
- int bound = curlwp->l_pflag & LP_BOUND;
+ int bound;
if (pfi_all != NULL) /* already initialized */
return;
@@ -122,7 +122,7 @@ pfi_initialize(void)
#ifdef __NetBSD__
ifnet_t *ifp;
- curlwp->l_pflag |= LP_BOUND;
+ bound = curlwp_bind();
s = pserialize_read_enter();
IFNET_READER_FOREACH(ifp) {
struct psref psref;
@@ -136,7 +136,7 @@ pfi_initialize(void)
psref_release(&psref, &ifp->if_psref, ifnet_psref_class);
}
pserialize_read_exit(s);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
pfil_add_hook(pfil_ifnet_wrapper, NULL, PFIL_IFNET, if_pfil);
pfil_add_hook(pfil_ifaddr_wrapper, NULL, PFIL_IFADDR, if_pfil);
@@ -150,12 +150,12 @@ pfi_destroy(void)
struct pfi_kif *p;
ifnet_t *ifp;
int s;
- int bound = curlwp->l_pflag & LP_BOUND;
+ int bound;
pfil_remove_hook(pfil_ifaddr_wrapper, NULL, PFIL_IFADDR, if_pfil);
pfil_remove_hook(pfil_ifnet_wrapper, NULL, PFIL_IFNET, if_pfil);
- curlwp->l_pflag |= LP_BOUND;
+ bound = curlwp_bind();
s = pserialize_read_enter();
IFNET_READER_FOREACH(ifp) {
struct psref psref;
@@ -169,7 +169,7 @@ pfi_destroy(void)
psref_release(&psref, &ifp->if_psref, ifnet_psref_class);
}
pserialize_read_exit(s);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
while ((p = RB_MIN(pfi_ifhead, &pfi_ifs))) {
RB_REMOVE(pfi_ifhead, &pfi_ifs, p);
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 632a08a927a..fa923524ff9 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_mbuf.c,v 1.167 2016/06/10 13:31:44 ozaki-r Exp $ */
+/* $NetBSD: uipc_mbuf.c,v 1.168 2016/06/16 02:38:40 ozaki-r Exp $ */
/*-
* Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.167 2016/06/10 13:31:44 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.168 2016/06/16 02:38:40 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_mbuftrace.h"
@@ -558,8 +558,7 @@ m_reclaim(void *arg, int flags)
}
/* XXX we cannot use psref in H/W interrupt */
if (!cpu_intr_p()) {
- int bound = curlwp->l_pflag & LP_BOUND;
- curlwp->l_pflag |= LP_BOUND;
+ int bound = curlwp_bind();
IFNET_READER_FOREACH(ifp) {
struct psref psref;
@@ -572,7 +571,7 @@ m_reclaim(void *arg, int flags)
psref_release(&psref, &ifp->if_psref,
ifnet_psref_class);
}
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
}
splx(s);
mbstat.m_drain++;
diff --git a/sys/net/if.c b/sys/net/if.c
index 8b076e940f8..d9f698eefee 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if.c,v 1.338 2016/06/10 13:31:44 ozaki-r Exp $ */
+/* $NetBSD: if.c,v 1.339 2016/06/16 02:38:40 ozaki-r Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.338 2016/06/10 13:31:44 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.339 2016/06/16 02:38:40 ozaki-r Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -941,9 +941,8 @@ if_attachdomain(void)
{
struct ifnet *ifp;
int s;
- int bound = curlwp->l_pflag & LP_BOUND;
+ int bound = curlwp_bind();
- curlwp->l_pflag |= LP_BOUND;
s = pserialize_read_enter();
IFNET_READER_FOREACH(ifp) {
struct psref psref;
@@ -954,7 +953,7 @@ if_attachdomain(void)
psref_release(&psref, &ifp->if_psref, ifnet_psref_class);
}
pserialize_read_exit(s);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
}
static void
@@ -2478,7 +2477,7 @@ doifioctl(struct socket *so, u_long cmd, void *data, struct lwp *l)
#endif
int r;
struct psref psref;
- int bound = curlwp->l_pflag & LP_BOUND;
+ int bound;
switch (cmd) {
#ifdef COMPAT_OIFREQ
@@ -2510,7 +2509,7 @@ doifioctl(struct socket *so, u_long cmd, void *data, struct lwp *l)
switch (cmd) {
case SIOCIFCREATE:
case SIOCIFDESTROY:
- curlwp->l_pflag |= LP_BOUND;
+ bound = curlwp_bind();
if (l != NULL) {
ifp = if_get(ifr->ifr_name, &psref);
error = kauth_authorize_network(l->l_cred,
@@ -2520,7 +2519,7 @@ doifioctl(struct socket *so, u_long cmd, void *data, struct lwp *l)
if (ifp != NULL)
if_put(ifp, &psref);
if (error != 0) {
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
return error;
}
}
@@ -2529,7 +2528,7 @@ doifioctl(struct socket *so, u_long cmd, void *data, struct lwp *l)
if_clone_create(ifr->ifr_name) :
if_clone_destroy(ifr->ifr_name);
mutex_exit(&if_clone_mtx);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
return r;
case SIOCIFGCLONERS:
@@ -2540,10 +2539,10 @@ doifioctl(struct socket *so, u_long cmd, void *data, struct lwp *l)
}
}
- curlwp->l_pflag |= LP_BOUND;
+ bound = curlwp_bind();
ifp = if_get(ifr->ifr_name, &psref);
if (ifp == NULL) {
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
return ENXIO;
}
@@ -2617,7 +2616,7 @@ doifioctl(struct socket *so, u_long cmd, void *data, struct lwp *l)
mutex_exit(ifp->if_ioctl_lock);
out:
if_put(ifp, &psref);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
return error;
}
@@ -2661,7 +2660,7 @@ ifconf(u_long cmd, void *data)
const int sz = (int)sizeof(struct ifreq);
const bool docopy = ifc->ifc_req != NULL;
int s;
- int bound = curlwp->l_pflag & LP_BOUND;
+ int bound;
struct psref psref;
if (docopy) {
@@ -2669,7 +2668,7 @@ ifconf(u_long cmd, void *data)
ifrp = ifc->ifc_req;
}
- curlwp->l_pflag |= LP_BOUND;
+ bound = curlwp_bind();
s = pserialize_read_enter();
IFNET_READER_FOREACH(ifp) {
psref_acquire(&psref, &ifp->if_psref, ifnet_psref_class);
@@ -2719,7 +2718,7 @@ ifconf(u_long cmd, void *data)
psref_release(&psref, &ifp->if_psref, ifnet_psref_class);
}
pserialize_read_exit(s);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
if (docopy) {
KASSERT(0 <= space && space <= ifc->ifc_len);
@@ -2732,7 +2731,7 @@ ifconf(u_long cmd, void *data)
release_exit:
psref_release(&psref, &ifp->if_psref, ifnet_psref_class);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
return error;
}
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index e8d410f1617..e8f0e905e9c 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rtsock.c,v 1.189 2016/06/10 13:27:16 ozaki-r Exp $ */
+/* $NetBSD: rtsock.c,v 1.190 2016/06/16 02:38:40 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.189 2016/06/10 13:27:16 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.190 2016/06/16 02:38:40 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1460,11 +1460,10 @@ sysctl_iflist(int af, struct rt_walkarg *w, int type)
int len, error = 0;
int s;
struct psref psref;
- int bound = curlwp->l_pflag & LP_BOUND;
+ int bound = curlwp_bind();
memset(&info, 0, sizeof(info));
- curlwp->l_pflag |= LP_BOUND;
s = pserialize_read_enter();
IFNET_READER_FOREACH(ifp) {
if (w->w_arg && w->w_arg != ifp->if_index)
@@ -1560,13 +1559,13 @@ sysctl_iflist(int af, struct rt_walkarg *w, int type)
psref_release(&psref, &ifp->if_psref, ifnet_psref_class);
}
pserialize_read_exit(s);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
return 0;
release_exit:
psref_release(&psref, &ifp->if_psref, ifnet_psref_class);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
return error;
}
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 7b9adad30bb..b9d84b28912 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_carp.c,v 1.67 2016/06/10 13:31:44 ozaki-r Exp $ */
+/* $NetBSD: ip_carp.c,v 1.68 2016/06/16 02:38:40 ozaki-r Exp $ */
/* $OpenBSD: ip_carp.c,v 1.113 2005/11/04 08:11:54 mcbride Exp $ */
/*
@@ -33,7 +33,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.67 2016/06/10 13:31:44 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.68 2016/06/16 02:38:40 ozaki-r Exp $");
/*
* TODO:
@@ -933,9 +933,8 @@ carp_send_ad_all(void)
struct carp_if *cif;
struct carp_softc *vh;
int s;
- int bound = curlwp->l_pflag & LP_BOUND;
+ int bound = curlwp_bind();
- curlwp->l_pflag |= LP_BOUND;
s = pserialize_read_enter();
IFNET_READER_FOREACH(ifp) {
struct psref psref;
@@ -956,7 +955,7 @@ carp_send_ad_all(void)
psref_release(&psref, &ifp->if_psref, ifnet_psref_class);
}
pserialize_read_exit(s);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
}
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 92392dcf85c..352b7536d42 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -1,4 +1,4 @@
-/* $NetBSD: raw_ip6.c,v 1.144 2016/06/10 13:31:44 ozaki-r Exp $ */
+/* $NetBSD: raw_ip6.c,v 1.145 2016/06/16 02:38:40 ozaki-r Exp $ */
/* $KAME: raw_ip6.c,v 1.82 2001/07/23 18:57:56 jinmei Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.144 2016/06/10 13:31:44 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.145 2016/06/16 02:38:40 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_ipsec.h"
@@ -387,9 +387,7 @@ rip6_output(struct mbuf *m, struct socket * const so,
int type, code; /* for ICMPv6 output statistics only */
int scope_ambiguous = 0;
struct in6_addr *in6a;
- int bound = curlwp->l_pflag & LP_BOUND;
-
- curlwp->l_pflag |= LP_BOUND;
+ int bound = curlwp_bind();
in6p = sotoin6pcb(so);
@@ -536,7 +534,7 @@ rip6_output(struct mbuf *m, struct socket * const so,
ip6_clearpktopts(&opt, -1);
m_freem(control);
}
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
return error;
}
diff --git a/sys/rump/net/lib/libshmif/if_shmem.c b/sys/rump/net/lib/libshmif/if_shmem.c
index 0e2616f3c86..a885aee1b8e 100644
--- a/sys/rump/net/lib/libshmif/if_shmem.c
+++ b/sys/rump/net/lib/libshmif/if_shmem.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_shmem.c,v 1.67 2016/06/10 13:27:16 ozaki-r Exp $ */
+/* $NetBSD: if_shmem.c,v 1.68 2016/06/16 02:38:40 ozaki-r Exp $ */
/*
* Copyright (c) 2009, 2010 Antti Kantee. All Rights Reserved.
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.67 2016/06/10 13:27:16 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.68 2016/06/16 02:38:40 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -764,14 +764,14 @@ shmif_rcv(void *arg)
}
if (passup) {
- int bound = curlwp->l_pflag & LP_BOUND;
+ int bound;
ifp->if_ipackets++;
KERNEL_LOCK(1, NULL);
/* Prevent LWP migrations between CPUs for psref(9) */
- curlwp->l_pflag |= LP_BOUND;
+ bound = curlwp_bind();
bpf_mtap(ifp, m);
if_input(ifp, m);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
KERNEL_UNLOCK_ONE(NULL);
m = NULL;
}
diff --git a/sys/rump/net/lib/libvirtif/if_virt.c b/sys/rump/net/lib/libvirtif/if_virt.c
index 076bfded299..14ae276f87e 100644
--- a/sys/rump/net/lib/libvirtif/if_virt.c
+++ b/sys/rump/net/lib/libvirtif/if_virt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_virt.c,v 1.52 2016/06/10 13:27:17 ozaki-r Exp $ */
+/* $NetBSD: if_virt.c,v 1.53 2016/06/16 02:38:40 ozaki-r Exp $ */
/*
* Copyright (c) 2008, 2013 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.52 2016/06/10 13:27:17 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.53 2016/06/16 02:38:40 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -374,15 +374,15 @@ VIF_DELIVERPKT(struct virtif_sc *sc, struct iovec *iov, size_t iovlen)
}
if (passup) {
- int bound = curlwp->l_pflag & LP_BOUND;
+ int bound;
ifp->if_ipackets++;
m_set_rcvif(m, ifp);
KERNEL_LOCK(1, NULL);
/* Prevent LWP migrations between CPUs for psref(9) */
- curlwp->l_pflag |= LP_BOUND;
+ bound = curlwp_bind();
bpf_mtap(ifp, m);
if_input(ifp, m);
- curlwp->l_pflag ^= bound ^ LP_BOUND;
+ curlwp_bindx(bound);
KERNEL_UNLOCK_LAST(NULL);
} else {
m_freem(m);