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
David Holder
david.holder at erion.co.uk
Tue Oct 2 21:11:40 GMT 2007
Jeremy,
I agree it seems like the way to go. I've not tried getifaddrs on
systems other than Linux, it will be interesting to see if it works.
David
------------------------------------------------------------------------
Dr David Holder CEng FIET MIEEE
Erion Ltd, Oakleigh, Upper Sutherland Road, Halifax, HX3 8NT
Reception: +44 (0)1422 207000
Direct Dial: +44 (0)131 2026317
Cell: +44 (0) 7768 456831
Registered in England and Wales. Registered Number 3521142
VAT Number: GB 698 3633 78
Jeremy Allison wrote:
> 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.
>
> Jeremy.
>
More information about the samba-technical
mailing list