Date: Tue, 18 Aug 2015 18:12:46 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286894 - head/sys/rpc Message-ID: <201508181812.t7IICk88058528@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Tue Aug 18 18:12:46 2015 New Revision: 286894 URL: https://svnweb.freebsd.org/changeset/base/286894 Log: Set curvnet context inside the RPC code in more places. Reviewed by: melifaro MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3398 Modified: head/sys/rpc/rpc_generic.c head/sys/rpc/svc_vc.c Modified: head/sys/rpc/rpc_generic.c ============================================================================== --- head/sys/rpc/rpc_generic.c Tue Aug 18 15:50:02 2015 (r286893) +++ head/sys/rpc/rpc_generic.c Tue Aug 18 18:12:46 2015 (r286894) @@ -703,7 +703,9 @@ __rpc_sockisbound(struct socket *so) struct sockaddr *sa; int error, bound; + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + CURVNET_RESTORE(); if (error) return (0); @@ -791,7 +793,9 @@ bindresvport(struct socket *so, struct s socklen_t salen; if (sa == NULL) { + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + CURVNET_RESTORE(); if (error) return (error); freesa = TRUE; Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Tue Aug 18 15:50:02 2015 (r286893) +++ head/sys/rpc/svc_vc.c Tue Aug 18 18:12:46 2015 (r286894) @@ -150,7 +150,9 @@ svc_vc_create(SVCPOOL *pool, struct sock 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 sock 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 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508181812.t7IICk88058528>