From 11ccde281407ee27640bcbb97e28aa895001cacd Mon Sep 17 00:00:00 2001 From: delphij Date: Tue, 1 Sep 2015 01:01:35 +0000 Subject: MFC r286894: Set curvnet context inside the RPC code in more places. Reviewed by: melifaro --- sys/rpc/svc_vc.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys/rpc/svc_vc.c') diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index fb40a34..be8e04e 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -150,7 +150,9 @@ svc_vc_create(SVCPOOL *pool, struct socket *so, size_t sendsize, SOCK_LOCK(so); if (so->so_state & (SS_ISCONNECTED|SS_ISDISCONNECTED)) { SOCK_UNLOCK(so); + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_peeraddr(so, &sa); + CURVNET_RESTORE(); if (error) return (NULL); xprt = svc_vc_create_conn(pool, so, sa); @@ -167,7 +169,9 @@ svc_vc_create(SVCPOOL *pool, struct socket *so, size_t sendsize, xprt->xp_p2 = NULL; xprt->xp_ops = &svc_vc_rendezvous_ops; + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + CURVNET_RESTORE(); if (error) { goto cleanup_svc_vc_create; } @@ -249,7 +253,9 @@ svc_vc_create_conn(SVCPOOL *pool, struct socket *so, struct sockaddr *raddr) memcpy(&xprt->xp_rtaddr, raddr, raddr->sa_len); + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + CURVNET_RESTORE(); if (error) goto cleanup_svc_vc_create; -- cgit v1.1