Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150805952
D29892.id88608.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D29892.id88608.diff
View Options
Index: sys/net/if.c
===================================================================
--- sys/net/if.c
+++ sys/net/if.c
@@ -149,6 +149,15 @@
CTASSERT(__offsetof(struct ifreq, ifr_ifru) ==
__offsetof(struct ifreq32, ifr_ifru));
+struct ifdrv32 {
+ char ifd_name[IFNAMSIZ];
+ uint32_t ifd_cmd;
+ uint32_t ifd_len;
+ uint32_t ifd_data;
+};
+#define SIOCSDRVSPEC32 _IOC_NEWTYPE(SIOCSDRVSPEC, struct ifdrv32)
+#define SIOCGDRVSPEC32 _IOC_NEWTYPE(SIOCGDRVSPEC, struct ifdrv32)
+
struct ifgroupreq32 {
char ifgr_name[IFNAMSIZ];
u_int ifgr_len;
@@ -2926,11 +2935,13 @@
#ifdef COMPAT_FREEBSD32
union {
struct ifconf ifc;
+ struct ifdrv ifd;
struct ifmediareq ifmr;
} thunk;
caddr_t saved_data;
u_long saved_cmd;
struct ifconf32 *ifc32;
+ struct ifdrv32 *ifd32;
struct ifmediareq32 *ifmr32;
#endif
struct ifnet *ifp;
@@ -2962,6 +2973,17 @@
data = (caddr_t)&thunk.ifc;
cmd = SIOCGIFCONF;
break;
+ case SIOCGDRVSPEC32:
+ case SIOCSDRVSPEC32:
+ ifd32 = (struct ifdrv32 *)data;
+ memcpy(thunk.ifd.ifd_name, ifd32->ifd_name,
+ sizeof(thunk.ifd.ifd_name));
+ thunk.ifd.ifd_cmd = ifd32->ifd_cmd;
+ thunk.ifd.ifd_len = ifd32->ifd_len;
+ thunk.ifd.ifd_data = PTRIN(ifd32->ifd_data);
+ data = (caddr_t)&thunk.ifd;
+ cmd = _IOC_NEWTYPE(cmd, struct ifdrv);
+ break;
case SIOCGIFMEDIA32:
case SIOCGIFXMEDIA32:
ifmr32 = (struct ifmediareq32 *)data;
@@ -3082,6 +3104,17 @@
case SIOCGIFCONF32:
ifc32->ifc_len = thunk.ifc.ifc_len;
break;
+ case SIOCGDRVSPEC32:
+ /*
+ * SIOCGDRVSPEC is IOWR, but nothing actually touches
+ * the struct so just assert that ifd_len (the only
+ * field it might make sense to update) hasn't
+ * changed.
+ */
+ KASSERT(thunk.ifd.ifd_len == ifd32->ifd_len,
+ ("ifd_len was updated %u -> %zu", ifd32->ifd_len,
+ thunk.ifd.ifd_len));
+ break;
case SIOCGIFMEDIA32:
case SIOCGIFXMEDIA32:
ifmr32->ifm_current = thunk.ifmr.ifm_current;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 5, 4:30 AM (12 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30869261
Default Alt Text
D29892.id88608.diff (1 KB)
Attached To
Mode
D29892: Add freebsd32 compat shims for SIOC[GS]DRVSPEC.
Attached
Detach File
Event Timeline
Log In to Comment