[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] SIOCGIFINDEX: fix typo
From: |
Joakim Tjernlund |
Subject: |
Re: [Qemu-devel] [PATCH] SIOCGIFINDEX: fix typo |
Date: |
Fri, 11 Jul 2014 04:35:25 +0200 |
Joakim Tjernlund/Transmode wrote on 2014/07/11 03:45:27:
>
> Joakim Tjernlund <address@hidden> wrote on 2014/07/11
03:02:02:
> >
> > Wrong type was used in ioctl definition.
> >
> > Signed-off-by: Joakim Tjernlund <address@hidden>
> > ---
> >
> > 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