This is the mail archive of the
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
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 <email@example.com>
diff -Nuarp glibc-2.7.old/sysdeps/unix/sysv/linux/netpacket/packet.h
--- glibc-2.7.old/sysdeps/unix/sysv/linux/netpacket/packet.h 2001-07-06
+++ glibc-2.7/sysdeps/unix/sysv/linux/netpacket/packet.h 2008-06-02
@@ -28,7 +28,7 @@ struct sockaddr_ll
unsigned short int sll_hatype;
unsigned char sll_pkttype;
unsigned char sll_halen;
- unsigned char sll_addr;
+ unsigned char sll_addr;
/* Packet types. */