This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
[RFC][PATCH] getifaddrs doesnt deal with Infiniband deviceaddresses
- From: Vinay Sridhar <vinay at linux dot vnet dot ibm dot com>
- To: libc-help at sourceware dot org
- Cc: suzuki at in dot ibm dot com
- Date: Mon, 09 Jun 2008 12:51:07 +0530
- Subject: [RFC][PATCH] getifaddrs doesnt deal with Infiniband deviceaddresses
Hi All,
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?
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. */