diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2011-06-05 17:31:44 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2011-06-05 17:31:44 +0000 |
commit | c16b5c2bd2ccc68700c5e0c73a0b073be9c7b44f (patch) | |
tree | cfbbbff2e84415d309d4a8fd8251bebf404dbf84 /sys/fs/nfsclient/nfs_clport.c | |
parent | fba76e8544240faef25943d9886fc3bc31161eb9 (diff) | |
download | FreeBSD-src-c16b5c2bd2ccc68700c5e0c73a0b073be9c7b44f.zip FreeBSD-src-c16b5c2bd2ccc68700c5e0c73a0b073be9c7b44f.tar.gz |
Fix the new NFSv4 client so that it doesn't crash when
a mount is done for a VIMAGE kernel.
Tested by: glz at hidden-powers dot com
Reviewed by: bz
MFC after: 2 weeks
Diffstat (limited to 'sys/fs/nfsclient/nfs_clport.c')
-rw-r--r-- | sys/fs/nfsclient/nfs_clport.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index 0c3a4c9..6647703 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -943,6 +943,7 @@ nfscl_getmyip(struct nfsmount *nmp, int *isinet6p) sad.sin_family = AF_INET; sad.sin_len = sizeof (struct sockaddr_in); sad.sin_addr.s_addr = sin->sin_addr.s_addr; + CURVNET_SET(CRED_TO_VNET(nmp->nm_sockreq.nr_cred)); rt = rtalloc1((struct sockaddr *)&sad, 0, 0UL); if (rt != NULL) { if (rt->rt_ifp != NULL && @@ -956,6 +957,7 @@ nfscl_getmyip(struct nfsmount *nmp, int *isinet6p) } RTFREE_LOCKED(rt); } + CURVNET_RESTORE(); #ifdef INET6 } else if (nmp->nm_nam->sa_family == AF_INET6) { struct sockaddr_in6 sad6, *sin6; @@ -966,6 +968,7 @@ nfscl_getmyip(struct nfsmount *nmp, int *isinet6p) sad6.sin6_family = AF_INET6; sad6.sin6_len = sizeof (struct sockaddr_in6); sad6.sin6_addr = sin6->sin6_addr; + CURVNET_SET(CRED_TO_VNET(nmp->nm_sockreq.nr_cred)); rt = rtalloc1((struct sockaddr *)&sad6, 0, 0UL); if (rt != NULL) { if (rt->rt_ifp != NULL && @@ -980,6 +983,7 @@ nfscl_getmyip(struct nfsmount *nmp, int *isinet6p) } RTFREE_LOCKED(rt); } + CURVNET_RESTORE(); #endif } return (retp); |