svn commit: r222718 - head/sys/fs/nfsclient
Rick Macklem
rmacklem at FreeBSD.org
Sun Jun 5 17:31:45 UTC 2011
Author: rmacklem
Date: Sun Jun 5 17:31:44 2011
New Revision: 222718
URL: http://svn.freebsd.org/changeset/base/222718
Log:
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
Modified:
head/sys/fs/nfsclient/nfs_clport.c
Modified: head/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clport.c Sun Jun 5 14:46:42 2011 (r222717)
+++ head/sys/fs/nfsclient/nfs_clport.c Sun Jun 5 17:31:44 2011 (r222718)
@@ -943,6 +943,7 @@ nfscl_getmyip(struct nfsmount *nmp, int
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
}
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
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
}
RTFREE_LOCKED(rt);
}
+ CURVNET_RESTORE();
#endif
}
return (retp);
More information about the svn-src-head
mailing list