PERFORCE change 167830 for review
Marko Zec
zec at FreeBSD.org
Wed Aug 26 12:07:20 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=167830
Change 167830 by zec at zec_tpx32 on 2009/08/26 12:06:34
Attempt to properly set curvnet in linuxulator. Not tested yet.
Affected files ...
.. //depot/projects/vimage-commit2/src/sys/compat/linux/linux_ioctl.c#24 edit
Differences ...
==== //depot/projects/vimage-commit2/src/sys/compat/linux/linux_ioctl.c#24 (text+ko) ====
@@ -2104,6 +2104,7 @@
return (NULL);
index = 0;
is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0;
+ CURVNET_SET(TD_TO_VNET(td));
IFNET_RLOCK();
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
/*
@@ -2117,6 +2118,7 @@
break;
}
IFNET_RUNLOCK();
+ CURVNET_RESTORE();
if (ifp != NULL)
strlcpy(bsdname, ifp->if_xname, IFNAMSIZ);
return (ifp);
@@ -2146,6 +2148,7 @@
max_len = MAXPHYS - 1;
+ CURVNET_SET(TD_TO_VNET(td));
/* handle the 'request buffer size' case */
if (ifc.ifc_buf == PTROUT(NULL)) {
ifc.ifc_len = 0;
@@ -2157,11 +2160,14 @@
}
}
error = copyout(&ifc, uifc, sizeof(ifc));
+ CURVNET_RESTORE();
return (error);
}
- if (ifc.ifc_len <= 0)
+ if (ifc.ifc_len <= 0) {
+ CURVNET_RESTORE();
return (EINVAL);
+ }
again:
/* Keep track of eth interfaces */
@@ -2223,6 +2229,7 @@
memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len);
error = copyout(&ifc, uifc, sizeof(ifc));
sbuf_delete(sb);
+ CURVNET_RESTORE();
return (error);
}
More information about the p4-projects
mailing list