* [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-02-02 1:38 [Qemu-devel] [Bug 1814352] [NEW] SIOCGIFNAME takes a struct ifreq not an integer Erik Kline
@ 2019-04-09 13:51 ` Peter Maydell
2019-04-09 13:51 ` Peter Maydell
2019-04-09 18:18 ` Erik Kline
2019-04-23 22:31 ` Erik Kline
` (5 subsequent siblings)
6 siblings, 2 replies; 16+ messages in thread
From: Peter Maydell @ 2019-04-09 13:51 UTC (permalink / raw)
To: qemu-devel
Your suggested fix looks good -- did you want to send it to qemu-devel
with a suitable Signed-off-by: line ?
** Tags added: linux-user
** Changed in: qemu
Status: New => Confirmed
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1814352
Title:
SIOCGIFNAME takes a struct ifreq not an integer
Status in QEMU:
Confirmed
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-user/ioctls.h b/linux-user/ioctls.h
index ae8951625f..37501f575c 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -178,7 +178,7 @@
#endif /* CONFIG_USBFS */
IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
- IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
"""
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1814352/+subscriptions
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-04-09 13:51 ` [Qemu-devel] [Bug 1814352] " Peter Maydell
@ 2019-04-09 13:51 ` Peter Maydell
2019-04-09 18:18 ` Erik Kline
1 sibling, 0 replies; 16+ messages in thread
From: Peter Maydell @ 2019-04-09 13:51 UTC (permalink / raw)
To: qemu-devel
Your suggested fix looks good -- did you want to send it to qemu-devel
with a suitable Signed-off-by: line ?
** Tags added: linux-user
** Changed in: qemu
Status: New => Confirmed
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1814352
Title:
SIOCGIFNAME takes a struct ifreq not an integer
Status in QEMU:
Confirmed
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-user/ioctls.h b/linux-user/ioctls.h
index ae8951625f..37501f575c 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -178,7 +178,7 @@
#endif /* CONFIG_USBFS */
IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
- IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
"""
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1814352/+subscriptions
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-04-09 13:51 ` [Qemu-devel] [Bug 1814352] " Peter Maydell
2019-04-09 13:51 ` Peter Maydell
@ 2019-04-09 18:18 ` Erik Kline
2019-04-09 18:18 ` Erik Kline
2019-04-09 20:16 ` Peter Maydell
1 sibling, 2 replies; 16+ messages in thread
From: Erik Kline @ 2019-04-09 18:18 UTC (permalink / raw)
To: qemu-devel
Sure. Looking at HEAD, and even the surrounding the lines, I think I
should have tried STRUCT_short_ifreq instead of STRUCT_int_ifreq, though
I'm not sure what the real difference would be.
I'll try to test internally with the _short_ version and if that works send
that.
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1814352
Title:
SIOCGIFNAME takes a struct ifreq not an integer
Status in QEMU:
Confirmed
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-user/ioctls.h b/linux-user/ioctls.h
index ae8951625f..37501f575c 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -178,7 +178,7 @@
#endif /* CONFIG_USBFS */
IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
- IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
"""
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1814352/+subscriptions
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-04-09 18:18 ` Erik Kline
@ 2019-04-09 18:18 ` Erik Kline
2019-04-09 20:16 ` Peter Maydell
1 sibling, 0 replies; 16+ messages in thread
From: Erik Kline @ 2019-04-09 18:18 UTC (permalink / raw)
To: qemu-devel
Sure. Looking at HEAD, and even the surrounding the lines, I think I
should have tried STRUCT_short_ifreq instead of STRUCT_int_ifreq, though
I'm not sure what the real difference would be.
I'll try to test internally with the _short_ version and if that works send
that.
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1814352
Title:
SIOCGIFNAME takes a struct ifreq not an integer
Status in QEMU:
Confirmed
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-user/ioctls.h b/linux-user/ioctls.h
index ae8951625f..37501f575c 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -178,7 +178,7 @@
#endif /* CONFIG_USBFS */
IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
- IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
"""
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1814352/+subscriptions
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-04-09 18:18 ` Erik Kline
2019-04-09 18:18 ` Erik Kline
@ 2019-04-09 20:16 ` Peter Maydell
2019-04-09 20:16 ` Peter Maydell
2019-04-09 20:16 ` Peter Maydell
1 sibling, 2 replies; 16+ messages in thread
From: Peter Maydell @ 2019-04-09 20:16 UTC (permalink / raw)
To: Bug 1814352; +Cc: QEMU Developers
On Wed, 10 Apr 2019 at 01:26, Erik Kline <1814352@bugs.launchpad.net> wrote:
> Sure. Looking at HEAD, and even the surrounding the lines, I think I
> should have tried STRUCT_short_ifreq instead of STRUCT_int_ifreq, though
> I'm not sure what the real difference would be.
The multiple STRUCT_*_ifreq are working around the fact that
our MK_STRUCT infrastructure can't handle unions. The struct
ifreq is a char array followed by a union whose members are
various different types. You should use the STRUCT_*_ifreq
corresponding to whatever type the union field used by this
particular ioctl is. For SIOCGIFNAME the ifr_ifindex is read,
and that's an int, so you want STRUCT_int_ifreq. (If you used
the 'short' version by mistake this would probably break for the
case of big-endian guest and little-endian host or vice-versa
because we'd swap the wrong amount of data.)
thanks
-- PMM
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-04-09 20:16 ` Peter Maydell
@ 2019-04-09 20:16 ` Peter Maydell
2019-04-09 20:16 ` Peter Maydell
1 sibling, 0 replies; 16+ messages in thread
From: Peter Maydell @ 2019-04-09 20:16 UTC (permalink / raw)
To: qemu-devel
On Wed, 10 Apr 2019 at 01:26, Erik Kline <1814352@bugs.launchpad.net> wrote:
> Sure. Looking at HEAD, and even the surrounding the lines, I think I
> should have tried STRUCT_short_ifreq instead of STRUCT_int_ifreq, though
> I'm not sure what the real difference would be.
The multiple STRUCT_*_ifreq are working around the fact that
our MK_STRUCT infrastructure can't handle unions. The struct
ifreq is a char array followed by a union whose members are
various different types. You should use the STRUCT_*_ifreq
corresponding to whatever type the union field used by this
particular ioctl is. For SIOCGIFNAME the ifr_ifindex is read,
and that's an int, so you want STRUCT_int_ifreq. (If you used
the 'short' version by mistake this would probably break for the
case of big-endian guest and little-endian host or vice-versa
because we'd swap the wrong amount of data.)
thanks
-- PMM
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1814352
Title:
SIOCGIFNAME takes a struct ifreq not an integer
Status in QEMU:
Confirmed
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-user/ioctls.h b/linux-user/ioctls.h
index ae8951625f..37501f575c 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -178,7 +178,7 @@
#endif /* CONFIG_USBFS */
IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
- IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
"""
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1814352/+subscriptions
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-04-09 20:16 ` Peter Maydell
2019-04-09 20:16 ` Peter Maydell
@ 2019-04-09 20:16 ` Peter Maydell
1 sibling, 0 replies; 16+ messages in thread
From: Peter Maydell @ 2019-04-09 20:16 UTC (permalink / raw)
To: Bug 1814352; +Cc: QEMU Developers
On Wed, 10 Apr 2019 at 01:26, Erik Kline <1814352@bugs.launchpad.net> wrote:
> Sure. Looking at HEAD, and even the surrounding the lines, I think I
> should have tried STRUCT_short_ifreq instead of STRUCT_int_ifreq, though
> I'm not sure what the real difference would be.
The multiple STRUCT_*_ifreq are working around the fact that
our MK_STRUCT infrastructure can't handle unions. The struct
ifreq is a char array followed by a union whose members are
various different types. You should use the STRUCT_*_ifreq
corresponding to whatever type the union field used by this
particular ioctl is. For SIOCGIFNAME the ifr_ifindex is read,
and that's an int, so you want STRUCT_int_ifreq. (If you used
the 'short' version by mistake this would probably break for the
case of big-endian guest and little-endian host or vice-versa
because we'd swap the wrong amount of data.)
thanks
-- PMM
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-02-02 1:38 [Qemu-devel] [Bug 1814352] [NEW] SIOCGIFNAME takes a struct ifreq not an integer Erik Kline
2019-04-09 13:51 ` [Qemu-devel] [Bug 1814352] " Peter Maydell
@ 2019-04-23 22:31 ` Erik Kline
2019-04-23 22:31 ` Erik Kline
2019-04-29 22:15 ` Erik Kline
` (4 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Erik Kline @ 2019-04-23 22:31 UTC (permalink / raw)
To: qemu-devel
Patch sent to the list. Apologies for the delay.
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1814352
Title:
SIOCGIFNAME takes a struct ifreq not an integer
Status in QEMU:
Confirmed
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-user/ioctls.h b/linux-user/ioctls.h
index ae8951625f..37501f575c 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -178,7 +178,7 @@
#endif /* CONFIG_USBFS */
IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
- IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
"""
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1814352/+subscriptions
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-04-23 22:31 ` Erik Kline
@ 2019-04-23 22:31 ` Erik Kline
0 siblings, 0 replies; 16+ messages in thread
From: Erik Kline @ 2019-04-23 22:31 UTC (permalink / raw)
To: qemu-devel
Patch sent to the list. Apologies for the delay.
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1814352
Title:
SIOCGIFNAME takes a struct ifreq not an integer
Status in QEMU:
Confirmed
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-user/ioctls.h b/linux-user/ioctls.h
index ae8951625f..37501f575c 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -178,7 +178,7 @@
#endif /* CONFIG_USBFS */
IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
- IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
"""
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1814352/+subscriptions
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-02-02 1:38 [Qemu-devel] [Bug 1814352] [NEW] SIOCGIFNAME takes a struct ifreq not an integer Erik Kline
2019-04-09 13:51 ` [Qemu-devel] [Bug 1814352] " Peter Maydell
2019-04-23 22:31 ` Erik Kline
@ 2019-04-29 22:15 ` Erik Kline
2019-04-29 22:15 ` Erik Kline
2019-05-06 16:54 ` Erik Kline
` (3 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Erik Kline @ 2019-04-29 22:15 UTC (permalink / raw)
To: qemu-devel
Please let me know if further work or another patch submission is
required.
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1814352
Title:
SIOCGIFNAME takes a struct ifreq not an integer
Status in QEMU:
Confirmed
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-user/ioctls.h b/linux-user/ioctls.h
index ae8951625f..37501f575c 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -178,7 +178,7 @@
#endif /* CONFIG_USBFS */
IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
- IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
"""
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1814352/+subscriptions
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-04-29 22:15 ` Erik Kline
@ 2019-04-29 22:15 ` Erik Kline
0 siblings, 0 replies; 16+ messages in thread
From: Erik Kline @ 2019-04-29 22:15 UTC (permalink / raw)
To: qemu-devel
Please let me know if further work or another patch submission is
required.
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1814352
Title:
SIOCGIFNAME takes a struct ifreq not an integer
Status in QEMU:
Confirmed
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-user/ioctls.h b/linux-user/ioctls.h
index ae8951625f..37501f575c 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -178,7 +178,7 @@
#endif /* CONFIG_USBFS */
IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
- IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
"""
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1814352/+subscriptions
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-02-02 1:38 [Qemu-devel] [Bug 1814352] [NEW] SIOCGIFNAME takes a struct ifreq not an integer Erik Kline
` (2 preceding siblings ...)
2019-04-29 22:15 ` Erik Kline
@ 2019-05-06 16:54 ` Erik Kline
2019-05-10 16:40 ` Erik Kline
` (2 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: Erik Kline @ 2019-05-06 16:54 UTC (permalink / raw)
To: qemu-devel
Please let me know if further work or another patch submission is
required.
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1814352
Title:
SIOCGIFNAME takes a struct ifreq not an integer
Status in QEMU:
Confirmed
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-user/ioctls.h b/linux-user/ioctls.h
index ae8951625f..37501f575c 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -178,7 +178,7 @@
#endif /* CONFIG_USBFS */
IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
- IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
"""
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1814352/+subscriptions
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-02-02 1:38 [Qemu-devel] [Bug 1814352] [NEW] SIOCGIFNAME takes a struct ifreq not an integer Erik Kline
` (3 preceding siblings ...)
2019-05-06 16:54 ` Erik Kline
@ 2019-05-10 16:40 ` Erik Kline
2019-05-10 16:40 ` Erik Kline
2019-08-16 2:02 ` Erik Kline
6 siblings, 0 replies; 16+ messages in thread
From: Erik Kline @ 2019-05-10 16:40 UTC (permalink / raw)
To: qemu-devel
https://git.qemu.org/?p=qemu.git;a=commit;h=43330b7169ae76222472a4b20c7f4db9d8880527
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1814352
Title:
SIOCGIFNAME takes a struct ifreq not an integer
Status in QEMU:
Fix Committed
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-user/ioctls.h b/linux-user/ioctls.h
index ae8951625f..37501f575c 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -178,7 +178,7 @@
#endif /* CONFIG_USBFS */
IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
- IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
"""
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1814352/+subscriptions
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-02-02 1:38 [Qemu-devel] [Bug 1814352] [NEW] SIOCGIFNAME takes a struct ifreq not an integer Erik Kline
` (4 preceding siblings ...)
2019-05-10 16:40 ` Erik Kline
@ 2019-05-10 16:40 ` Erik Kline
2019-08-16 2:02 ` Erik Kline
6 siblings, 0 replies; 16+ messages in thread
From: Erik Kline @ 2019-05-10 16:40 UTC (permalink / raw)
To: qemu-devel
Thank you, all.
** Changed in: qemu
Status: Confirmed => Fix Committed
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1814352
Title:
SIOCGIFNAME takes a struct ifreq not an integer
Status in QEMU:
Fix Committed
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-user/ioctls.h b/linux-user/ioctls.h
index ae8951625f..37501f575c 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -178,7 +178,7 @@
#endif /* CONFIG_USBFS */
IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
- IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
"""
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1814352/+subscriptions
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
2019-02-02 1:38 [Qemu-devel] [Bug 1814352] [NEW] SIOCGIFNAME takes a struct ifreq not an integer Erik Kline
` (5 preceding siblings ...)
2019-05-10 16:40 ` Erik Kline
@ 2019-08-16 2:02 ` Erik Kline
6 siblings, 0 replies; 16+ messages in thread
From: Erik Kline @ 2019-08-16 2:02 UTC (permalink / raw)
To: qemu-devel
Released as part of v4.1.0.
** Changed in: qemu
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1814352
Title:
SIOCGIFNAME takes a struct ifreq not an integer
Status in QEMU:
Fix Released
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-user/ioctls.h b/linux-user/ioctls.h
index ae8951625f..37501f575c 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -178,7 +178,7 @@
#endif /* CONFIG_USBFS */
IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
- IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
"""
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1814352/+subscriptions
^ permalink raw reply [flat|nested] 16+ messages in thread