This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: [RFC][PATCH] getifaddrs doesnt deal with Infiniband device addresses
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: "Vinay Sridhar" <vinay at linux dot vnet dot ibm dot com>
- Cc: libc-help at sourceware dot org, suzuki at in dot ibm dot com
- Date: Mon, 9 Jun 2008 09:08:56 -0400
- Subject: Re: [RFC][PATCH] getifaddrs doesnt deal with Infiniband device addresses
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=0TgJtXZz8TJuF5hnPZiOwFjqkLkxM8rTDAwgNZrzh8w=; b=BS3oOqYYKDTZt5htG4drqNGLfw9YA/FOoSa31Ml2aymDKMd1CFBCqdO5GvTR3zfaEo AHzldQcA8WJexCLM2y0ZlH+hhF0b4rZOn+5E4iOLqo3+udcPUzxOt0iGHtMRDydNXNX4 RqwuMAW6B5RJOuJ5wEH4UTXJXNztAeJbEWgcY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=u38E1g63NS9FumYStaGgJ8hspMw+Wkuu4ADN9ILPNKJxYKDSD+7nNKwkcz0Mmywl2S /faP5sDLT7z8GfxLaYOgtYh92Dx0Hp0p/uxpN1/lQ1eMjeQCX9lyWTxyKFQL89WePFNk 5DQJcqcpaybEWsajrvTSS7Qw7nRSElt9KAs5A=
- References: <1212996067.12425.5.camel@vinaysridhar.in.ibm.com>
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.