getifaddrs() issues on AIX

miguel.sanders at arcelormittal.com miguel.sanders at arcelormittal.com
Sat Dec 5 12:07:14 MST 2009


Hi Samba team

I would like to report that the "interfaces / bind interfaces only" features of Samba do not function on AIX.
There are two problematic situations:
(1) Assume interfaces en1 and en2 have an IP address whereas en0 does not.
(Simplified) netstat output on AIX would show something like:
# netstat -in
Name  Mtu   Network     Address           
en1   9000  link#2      22.f1.30.0.10.6        
en1   9000  10.226.32   10.226.32.222          
en2   1500  link#3      22.f1.30.0.10.8        
en2   1500  10.226.33   10.226.33.222          
en0*  65390 link#4      22.f1.30.0.10.4        
lo0   16896 link#1                             
lo0   16896 127         127.0.0.1              
lo0   16896 ::1                                

If there is no interfaces entry in smb.conf (f.e. interfaces = en1 or interfaces = en2), smbd will simply not start.
The problem lies in the rep_getifaddrs function in lib/replace/getifaddrs.c
AIX, unlike Linux, also returns info on the layer 2 HW address of the adapter in the ifconf struct (as can be observed from the output above).
As a result, one should only call the SIOCGIFADDR ioctl if the sin_family is AF_INET. 

(2) Assume interface en2 has IP aliases.
(Simplified) netstat output on AIX would show something like:
# netstat -in
Name  Mtu   Network     Address           
en2   1500  link#3      22.f1.30.0.10.8        
en2   1500  10.226.33   10.226.33.222          
en2   1500  139.53.231  139.53.231.201         
en2   1500  139.53.231  139.53.231.107         
lo0   16896 link#1                             
lo0   16896 127         127.0.0.1              
lo0   16896 ::1                                

The IP aliases cannot be used in the interfaces entry in smb.conf.
The problem also lies in the rep_getifaddrs function in lib/replace/getifaddrs.c
AIX, unlike Linux, does not create a new interface for each IP alias.
As a result, the SIOCGIFADDR ioctl does not return any IP aliases of the network interface, only the base IP address.

Bugzilla # 6970 (+ patch) was created to address these issues.

Could you have a look at the patch?

Cheers!

Met vriendelijke groet
Best regards
Bien à vous

Miguel SANDERS
ArcelorMittal Gent

UNIX Systems & Storage
IT Supply Western Europe | John Kennedylaan 51
B-9042 Gent

T +32 9 347 3538 | F +32 9 347 4901 | M +32478 805 023
E miguel.sanders at arcelormittal.com
www.arcelormittal.com/gent


**** 
This message and any attachment are confidential, intended solely for the use of the individual or entity to whom it is addressed and may be protected by professional secrecy or intellectual property rights. 
If you have received it by mistake, or are not the named recipient(s), please immediately notify the sender and delete the message. You are hereby notified that any unauthorized use, copying or dissemination of any or all information contained in this message is prohibited. 
Arcelormittal shall not be liable for the message if altered, falsified, or in case of error in the recipient. 
This message does not constitute any right or commitment for ArcelorMittal except when expressly agreed otherwise in writing in a separate agreement.  
****  



More information about the samba-technical mailing list