svn commit: samba r25472 - in branches: SAMBA_3_2/source SAMBA_3_2/source/include SAMBA_3_2/source/lib SAMBA_3_2/source/lib/replace SAMBA_3_2/source/lib/replace/system SAMBA_3_2/source/utils SAMBA_3_2_0/source SAMBA_3_2_0/source/include SAMBA_3_2_0/source/lib SAMBA_3_2_0/source/lib/replace SAMBA_3_2_0/source/lib/replace/system SAMBA_3_2_0/source/utils

Jeremy Allison jra at
Tue Oct 2 21:04:36 GMT 2007

On Tue, Oct 02, 2007 at 09:54:29PM +0100, David Holder wrote:
> Jeremy,
> Is the purpose of this code to enumerate interfaces or addresses? The 
> reason that I ask is that the standard way to enumerate interfaces is  
> if_nameindex().

This is enumerating interfaces. I'm starting from the ground up,
and Samba currently has lots of code for different systems for
discovering existing network interfaces. I've just added one
that uses getifaddrs/freeifaddrs - I think this one should get
me both interfaces and addresses in one linked list. On modern
Linux systems (recent Ubuntu 7.04) it seems to do this.

> Listing addresses is harder. On most, but not all, platforms 
> getifaddrs() is IPv4 only. A number of platforms, but not all, support 
> the use of the SIOCGIFADDR ioctl to enumerate IPv6 addresses. On Linux 
> rtnetlink can be used.

On modern Linux getifaddrs is returning any configured IPv6
addresses as well as IPv4 ones. I think this may be the way
to go on most systems.


More information about the samba-technical mailing list