diff options
author | bz <bz@FreeBSD.org> | 2011-02-16 21:29:13 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2011-02-16 21:29:13 +0000 |
commit | b9b7d3e93a251adacd363eaf9d23963ec7467075 (patch) | |
tree | e312f60d853b2306ae67fe2988280d1dbc41c9cf /sys/nfsclient/bootp_subr.c | |
parent | ea2186a5ebf08dfc9eddc393caec2d574ac8ce0b (diff) | |
download | FreeBSD-src-b9b7d3e93a251adacd363eaf9d23963ec7467075.zip FreeBSD-src-b9b7d3e93a251adacd363eaf9d23963ec7467075.tar.gz |
Mfp4 CH=177274,177280,177284-177285,177297,177324-177325
VNET socket push back:
try to minimize the number of places where we have to switch vnets
and narrow down the time we stay switched. Add assertions to the
socket code to catch possibly unset vnets as seen in r204147.
While this reduces the number of vnet recursion in some places like
NFS, POSIX local sockets and some netgraph, .. recursions are
impossible to fix.
The current expectations are documented at the beginning of
uipc_socket.c along with the other information there.
Sponsored by: The FreeBSD Foundation
Sponsored by: CK Software GmbH
Reviewed by: jhb
Tested by: zec
Tested by: Mikolaj Golub (to.my.trociny gmail.com)
MFC after: 2 weeks
Diffstat (limited to 'sys/nfsclient/bootp_subr.c')
-rw-r--r-- | sys/nfsclient/bootp_subr.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/nfsclient/bootp_subr.c b/sys/nfsclient/bootp_subr.c index cff72c7..9fcd03f 100644 --- a/sys/nfsclient/bootp_subr.c +++ b/sys/nfsclient/bootp_subr.c @@ -584,8 +584,6 @@ bootpc_call(struct bootpc_globalcontext *gctx, struct thread *td) int retry; const char *s; - CURVNET_SET(TD_TO_VNET(td)); - /* * Create socket and set its recieve timeout. */ @@ -962,7 +960,6 @@ gotreply: out: soclose(so); out0: - CURVNET_RESTORE(); return error; } @@ -977,8 +974,6 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx, struct ifaddr *ifa; struct sockaddr_dl *sdl; - CURVNET_SET(TD_TO_VNET(td)); - error = socreate(AF_INET, &ifctx->so, SOCK_DGRAM, 0, td->td_ucred, td); if (error != 0) panic("nfs_boot: socreate, error=%d", error); @@ -1053,8 +1048,6 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx, ifctx->ireq.ifr_name); ifctx->sdl = sdl; - CURVNET_RESTORE(); - return error; } @@ -1630,6 +1623,7 @@ bootpc_init(void) /* * Find a network interface. */ + CURVNET_SET(TD_TO_VNET(td)); #ifdef BOOTP_WIRED_TO printf("bootpc_init: wired to interface '%s'\n", __XSTRING(BOOTP_WIRED_TO)); @@ -1676,6 +1670,7 @@ bootpc_init(void) ifctx = ifctx->next; } IFNET_RUNLOCK(); + CURVNET_RESTORE(); if (gctx->interfaces == NULL || gctx->interfaces->ifp == NULL) { #ifdef BOOTP_WIRED_TO |