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 200
1-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. */
|