* [Qemu-devel] [PATCH] SIOCGIFINDEX: fix typo
@ 2014-07-11 1:02 Joakim Tjernlund
2014-07-11 1:45 ` Joakim Tjernlund
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Joakim Tjernlund @ 2014-07-11 1:02 UTC (permalink / raw)
To: qemu-devel, riku.voipio; +Cc: Joakim Tjernlund
Wrong type was used in ioctl definition.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
---
However, this does not fix my dhcp problem:
jocke-ppc ~ # busybox udhcpc -v
Adapter index 24
MAC fe:22:44:22:55:77
udhcpc (v1.21.0) started
Executing /usr/share/udhcpc/default.script deconfig
Setting IP address 0.0.0.0 on eth0
Entering listen mode: raw
Opening raw socket on ifindex 24
Got raw socket fd
udhcpc: bind: No such device
jocke-ppc ~ # cat /sys/class/net/eth0/ifindex
24
linux-user/ioctls.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 07a00da..609b27c 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -118,7 +118,7 @@
IOCTL(SIOCSIFMEM, IOC_W, MK_PTR(MK_STRUCT(STRUCT_ptr_ifreq)))
IOCTL(SIOCADDMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
IOCTL(SIOCDELMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
- IOCTL(SIOCGIFINDEX, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
+ IOCTL(SIOCGIFINDEX, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCSIFLINK, 0, TYPE_NULL)
IOCTL_SPECIAL(SIOCGIFCONF, IOC_W | IOC_R, do_ioctl_ifconf,
MK_PTR(MK_STRUCT(STRUCT_ifconf)))
--
1.8.5.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] SIOCGIFINDEX: fix typo
2014-07-11 1:02 [Qemu-devel] [PATCH] SIOCGIFINDEX: fix typo Joakim Tjernlund
@ 2014-07-11 1:45 ` Joakim Tjernlund
[not found] ` <OF8A7EBADF.8903DC99-ONC1257D12.0008FBC2-C1257D12.0009A78D@LocalDomain>
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Joakim Tjernlund @ 2014-07-11 1:45 UTC (permalink / raw)
To: qemu-devel, riku.voipio; +Cc: Alexander Graf
Joakim Tjernlund <Joakim.Tjernlund@transmode.se> wrote on 2014/07/11
03:02:02:
>
> Wrong type was used in ioctl definition.
>
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> ---
>
> However, this does not fix my dhcp problem:
>
> jocke-ppc ~ # busybox udhcpc -v
> Adapter index 24
> MAC fe:22:44:22:55:77
> udhcpc (v1.21.0) started
> Executing /usr/share/udhcpc/default.script deconfig
> Setting IP address 0.0.0.0 on eth0
> Entering listen mode: raw
> Opening raw socket on ifindex 24
> Got raw socket fd
> udhcpc: bind: No such device
> jocke-ppc ~ # cat /sys/class/net/eth0/ifindex
> 24
I may have found the error, in target_to_host_sockaddr() we only have
sa_family = tswap16(target_saddr->sa_family); w.r.t endian.
However a AF_INET also have:
stSockAddr.sin_port = htons(1100);
stSockAddr.sin_addr.s_addr = htonl(INADDR_ANY);
There is no endian conversion for these(there may be other cases too?)
Jocke
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] SIOCGIFINDEX: fix typo
[not found] ` <OF8A7EBADF.8903DC99-ONC1257D12.0008FBC2-C1257D12.0009A78D@LocalDomain>
@ 2014-07-11 2:35 ` Joakim Tjernlund
0 siblings, 0 replies; 5+ messages in thread
From: Joakim Tjernlund @ 2014-07-11 2:35 UTC (permalink / raw)
To: qemu-devel, riku.voipio, Alexander Graf
Joakim Tjernlund/Transmode wrote on 2014/07/11 03:45:27:
>
> Joakim Tjernlund <Joakim.Tjernlund@transmode.se> wrote on 2014/07/11
03:02:02:
> >
> > Wrong type was used in ioctl definition.
> >
> > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> > ---
> >
> > However, this does not fix my dhcp problem:
> >
> > jocke-ppc ~ # busybox udhcpc -v
> > Adapter index 24
> > MAC fe:22:44:22:55:77
> > udhcpc (v1.21.0) started
> > Executing /usr/share/udhcpc/default.script deconfig
> > Setting IP address 0.0.0.0 on eth0
> > Entering listen mode: raw
> > Opening raw socket on ifindex 24
> > Got raw socket fd
> > udhcpc: bind: No such device
> > jocke-ppc ~ # cat /sys/class/net/eth0/ifindex
> > 24
> I may have found the error, in target_to_host_sockaddr() we only have
> sa_family = tswap16(target_saddr->sa_family); w.r.t endian.
> However a AF_INET also have:
> stSockAddr.sin_port = htons(1100);
> stSockAddr.sin_addr.s_addr = htonl(INADDR_ANY);
> There is no endian conversion for these(there may be other cases too?)
That was premature but there is PF_PACKET/AF_PACKET:
struct sockaddr_ll {
unsigned short sll_family; /* Always AF_PACKET */
unsigned short sll_protocol; /* Physical layer protocol */
int sll_ifindex; /* Interface number */
unsigned short sll_hatype; /* ARP hardware type */
unsigned char sll_pkttype; /* Packet type */
unsigned char sll_halen; /* Length of address */
unsigned char sll_addr[8]; /* Physical layer address */
};
BINDTODEVICE seems unimpl. too?
Both are used by busybox dhcp.
Jocke
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] SIOCGIFINDEX: fix typo
2014-07-11 1:02 [Qemu-devel] [PATCH] SIOCGIFINDEX: fix typo Joakim Tjernlund
2014-07-11 1:45 ` Joakim Tjernlund
[not found] ` <OF8A7EBADF.8903DC99-ONC1257D12.0008FBC2-C1257D12.0009A78D@LocalDomain>
@ 2014-07-12 16:38 ` Peter Maydell
2014-07-15 13:27 ` Riku Voipio
3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2014-07-12 16:38 UTC (permalink / raw)
To: Joakim Tjernlund; +Cc: Riku Voipio, QEMU Developers
On 11 July 2014 02:02, Joakim Tjernlund <Joakim.Tjernlund@transmode.se> wrote:
> Wrong type was used in ioctl definition.
>
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> ---
>
> However, this does not fix my dhcp problem:
>
> jocke-ppc ~ # busybox udhcpc -v
> Adapter index 24
> MAC fe:22:44:22:55:77
> udhcpc (v1.21.0) started
> Executing /usr/share/udhcpc/default.script deconfig
> Setting IP address 0.0.0.0 on eth0
> Entering listen mode: raw
> Opening raw socket on ifindex 24
> Got raw socket fd
> udhcpc: bind: No such device
> jocke-ppc ~ # cat /sys/class/net/eth0/ifindex
> 24
> linux-user/ioctls.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
> index 07a00da..609b27c 100644
> --- a/linux-user/ioctls.h
> +++ b/linux-user/ioctls.h
> @@ -118,7 +118,7 @@
> IOCTL(SIOCSIFMEM, IOC_W, MK_PTR(MK_STRUCT(STRUCT_ptr_ifreq)))
> IOCTL(SIOCADDMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
> IOCTL(SIOCDELMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
> - IOCTL(SIOCGIFINDEX, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
> + IOCTL(SIOCGIFINDEX, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
> IOCTL(SIOCSIFLINK, 0, TYPE_NULL)
> IOCTL_SPECIAL(SIOCGIFCONF, IOC_W | IOC_R, do_ioctl_ifconf,
> MK_PTR(MK_STRUCT(STRUCT_ifconf)))
> --
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] SIOCGIFINDEX: fix typo
2014-07-11 1:02 [Qemu-devel] [PATCH] SIOCGIFINDEX: fix typo Joakim Tjernlund
` (2 preceding siblings ...)
2014-07-12 16:38 ` Peter Maydell
@ 2014-07-15 13:27 ` Riku Voipio
3 siblings, 0 replies; 5+ messages in thread
From: Riku Voipio @ 2014-07-15 13:27 UTC (permalink / raw)
To: Joakim Tjernlund; +Cc: riku.voipio, qemu-devel
On Fri, Jul 11, 2014 at 03:02:02AM +0200, Joakim Tjernlund wrote:
> Wrong type was used in ioctl definition.
Thanks, Applied to linux-user
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> ---
>
> However, this does not fix my dhcp problem:
>
> jocke-ppc ~ # busybox udhcpc -v
> Adapter index 24
> MAC fe:22:44:22:55:77
> udhcpc (v1.21.0) started
> Executing /usr/share/udhcpc/default.script deconfig
> Setting IP address 0.0.0.0 on eth0
> Entering listen mode: raw
> Opening raw socket on ifindex 24
> Got raw socket fd
> udhcpc: bind: No such device
> jocke-ppc ~ # cat /sys/class/net/eth0/ifindex
> 24
> linux-user/ioctls.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
> index 07a00da..609b27c 100644
> --- a/linux-user/ioctls.h
> +++ b/linux-user/ioctls.h
> @@ -118,7 +118,7 @@
> IOCTL(SIOCSIFMEM, IOC_W, MK_PTR(MK_STRUCT(STRUCT_ptr_ifreq)))
> IOCTL(SIOCADDMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
> IOCTL(SIOCDELMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
> - IOCTL(SIOCGIFINDEX, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
> + IOCTL(SIOCGIFINDEX, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
> IOCTL(SIOCSIFLINK, 0, TYPE_NULL)
> IOCTL_SPECIAL(SIOCGIFCONF, IOC_W | IOC_R, do_ioctl_ifconf,
> MK_PTR(MK_STRUCT(STRUCT_ifconf)))
> --
> 1.8.5.5
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-07-15 13:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11 1:02 [Qemu-devel] [PATCH] SIOCGIFINDEX: fix typo Joakim Tjernlund
2014-07-11 1:45 ` Joakim Tjernlund
[not found] ` <OF8A7EBADF.8903DC99-ONC1257D12.0008FBC2-C1257D12.0009A78D@LocalDomain>
2014-07-11 2:35 ` Joakim Tjernlund
2014-07-12 16:38 ` Peter Maydell
2014-07-15 13:27 ` Riku Voipio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).