[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#312554: libc6: if_nameindex(3) returns broken list of network interfaces



On Wed, Jun 08, 2005 at 08:30:42PM +0200, Hans Ulrich Niedermann wrote:

> The returned list
> 
>   - does not contain "all network interface names" like the man page says.
>     It only includes those which have an IPv4 address configured on them.
> 
>   - does not contain "one [structure] for every interface present" like
>     the libc6 info page says.
>     It contains one if_nameindex structure for every IPv4 address
>     configured on the interface.

Well, glibc 2.3.2 uses ioctl(SIOCGIFCONF) to get the list of network
addresses. However the Linux kernel implements this ioctl for IPV4 only,
and the IPV4 implementation returns one ifconf structure for every
configured address. So what are you seeing is just glibc reporting
whatever it gets from the kernel.

You can try glibc 2.3.5 from experimental which AFAIK uses netlink
instead of SIOCGIFCONF. However that may bring other problems since
netlink is not a reliable protocol and it may drop messages if the
machine is loaded.

Gabor

-- 
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------



Reply to: