git: 488660360a71 - main - krpc/svc_vc: keep the vnet context during calls into rpctls
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 18 Jan 2025 06:08:17 UTC
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=488660360a71f65a31d3709559554c1a90f7220e commit 488660360a71f65a31d3709559554c1a90f7220e Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2025-01-18 06:01:46 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2025-01-18 06:07:45 +0000 krpc/svc_vc: keep the vnet context during calls into rpctls --- sys/rpc/svc_vc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index 9fc4108a5149..f70aabc5425d 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -493,6 +493,7 @@ svc_vc_destroy_common(SVCXPRT *xprt) if (xprt->xp_socket) { if ((xprt->xp_tls & (RPCTLS_FLAGS_HANDSHAKE | RPCTLS_FLAGS_HANDSHFAIL)) != 0) { + CURVNET_SET(xprt->xp_socket->so_vnet); if ((xprt->xp_tls & RPCTLS_FLAGS_HANDSHAKE) != 0) { /* * If the upcall fails, the socket has @@ -505,7 +506,6 @@ svc_vc_destroy_common(SVCXPRT *xprt) xprt->xp_sslproc, &reterr); } /* Must sorele() to get rid of reference. */ - CURVNET_SET(xprt->xp_socket->so_vnet); sorele(xprt->xp_socket); CURVNET_RESTORE(); } else @@ -853,13 +853,13 @@ tryagain: if ((xprt->xp_tls & RPCTLS_FLAGS_HANDSHAKE) != 0 && error == ENXIO) { KRPC_VNET(svc_vc_tls_alerts)++; - KRPC_CURVNET_RESTORE(); /* Disable reception. */ xprt->xp_dontrcv = TRUE; sx_xunlock(&xprt->xp_lock); ret = rpctls_srv_handlerecord(xprt->xp_sslsec, xprt->xp_sslusec, xprt->xp_sslrefno, xprt->xp_sslproc, &reterr); + KRPC_CURVNET_RESTORE(); sx_xlock(&xprt->xp_lock); xprt->xp_dontrcv = FALSE; if (ret != RPC_SUCCESS || reterr != RPCTLSERR_OK) {