SIOCGIFNAME takes a struct ifreq not an integer
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The ioctl SIOCGIFNAME takes a pointer to a struct ifreq, not an integer. This leads to if_indextoname() not correctly returning interface names (well, not if they're longer than 4 characters including the trailing NULL ;-).
This is observed on v3.1.0.
The following one-line patch will be sent to the qemu-devel mailing list:
"""
diff --git a/linux-
index ae8951625f.
--- a/linux-
+++ b/linux-
@@ -178,7 +178,7 @@
#endif /* CONFIG_USBFS */
IOCTL(
- IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(
IOCTL(
IOCTL(
IOCTL(
"""
Your suggested fix looks good -- did you want to send it to qemu-devel with a suitable Signed-off-by: line ?