This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][PATCH] getifaddrs doesnt deal with Infiniband device addresses


On Mon, Jun 9, 2008 at 3:21 AM, Vinay Sridhar <vinay@linux.vnet.ibm.com> wrote:
> On attempting to run getifaddrs() on a system with IB interfaces, the
> interface names for the IB interfaces(ipv6) were corrupt. The problem
> lies with infiniband device addresses not being dealt with correctly.
> The sockaddr_ll structure has an address field (sll_addr) which is of 8
> bytes. However, infiniband devices have 20 byte hardware addresses. As a
> result, when the address is memcpy'ed into the sll_addr field, the
> interface name that follows this field is corrupted. Hence, I have
> extended the sll_addr char array to accommodate IB addresses.
> Could you  please share your thoughts on this?

1. This structure must match the kernel include/linux/if_packet.h
(sockaddr_ll) structure which (as of 2.6.25-5) uses sll_addr[8].

At the kernel level, how is the IB address stored?

> Signed-off by : Vinay Sridhar <vinay@linux.vnet.ibm.com>
>
> diff -Nuarp glibc-2.7.old/sysdeps/unix/sysv/linux/netpacket/packet.h
> glibc-2.7/sysdeps/unix/sysv/linux/netpacket/packet.h
> --- glibc-2.7.old/sysdeps/unix/sysv/linux/netpacket/packet.h    2001-07-06
> 00:56:18.000000000 -0400
> +++ glibc-2.7/sysdeps/unix/sysv/linux/netpacket/packet.h        2008-06-02
> 00:11:36.000000000 -0400
> @@ -28,7 +28,7 @@ struct sockaddr_ll
>     unsigned short int sll_hatype;
>     unsigned char sll_pkttype;
>     unsigned char sll_halen;
> -    unsigned char sll_addr[8];
> +    unsigned char sll_addr[24];
>   };
>
>  /* Packet types.  */

2. Please have a look at the contribution guidelines.

http://sourceware.org/glibc/wiki/Contribution%20checklist

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]