--- fs/nfsclient/nfs_clport.c.orig 2011-05-19 03:35:52.000000000 +0200 +++ fs/nfsclient/nfs_clport.c 2011-05-28 11:03:16.563178326 +0200 @@ -943,7 +943,9 @@ 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(TD_TO_VNET(curthread)); rt = rtalloc1((struct sockaddr *)&sad, 0, 0UL); + CURVNET_RESTORE(); if (rt != NULL) { if (rt->rt_ifp != NULL && rt->rt_ifa != NULL && @@ -954,7 +956,9 @@ nfscl_getmyip(struct nfsmount *nmp, int laddr.s_addr = sin->sin_addr.s_addr; retp = (u_int8_t *)&laddr; } + CURVNET_SET(TD_TO_VNET(curthread)); RTFREE_LOCKED(rt); + CURVNET_RESTORE(); } #ifdef INET6 } else if (nmp->nm_nam->sa_family == AF_INET6) { @@ -966,7 +970,9 @@ 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(TD_TO_VNET(curthread)); rt = rtalloc1((struct sockaddr *)&sad6, 0, 0UL); + CURVNET_RESTORE(); if (rt != NULL) { if (rt->rt_ifp != NULL && rt->rt_ifa != NULL && @@ -978,7 +984,9 @@ nfscl_getmyip(struct nfsmount *nmp, int retp = (u_int8_t *)&laddr6; *isinet6p = 1; } + CURVNET_SET(TD_TO_VNET(curthread)); RTFREE_LOCKED(rt); + CURVNET_RESTORE(); } #endif }