AI_ADDRCONFIG once again [was: Re: svn commit: trunk/uClibc: extra/Configs include libc/inet]

Ricard Wanderlof ricard.wanderlof at axis.com
Tue Oct 21 08:33:14 UTC 2008


On Mon, 20 Oct 2008, Bernhard Reutner-Fischer wrote:

>>
>> -#if 0 /* unused code */
>> +#ifdef __UCLIBC_SUPPORT_AI_ADDRCONFIG__
>> #if __ASSUME_NETLINK_SUPPORT == 0
>> extern smallint __no_netlink_support attribute_hidden;
>> #else
>> # define __no_netlink_support 0
>> #endif
>> -#endif /* unused code */
>> +#endif /* __UCLIBC_SUPPORT_AI_ADDRCONFIG__ */
>>
>>
>> extern int __netlink_open (struct netlink_handle *h) attribute_hidden;
>
> Ok, and this is also not quite right. You added an extern reference to 
> __no_netlink_support here, where's the actual data for that symbol?

Agreed, it looks weird. However, looking at the latest svn:


#ifndef __ASSUME_NETLINK_SUPPORT
#define __ASSUME_NETLINK_SUPPORT 1
#endif

#ifdef __UCLIBC_SUPPORT_AI_ADDRCONFIG__
#if __ASSUME_NETLINK_SUPPORT == 0
/* suspicious: This will simply not work.. */
extern smallint __no_netlink_support attribute_hidden;
#else
# define __no_netlink_support 0
#endif
#endif /* __UCLIBC_SUPPORT_AI_ADDRCONFIG__ */


it can be seen that ASSUME_NETLINK_SUPPORT is set to 1 if not previously 
defined; in fact, this is the only place in uClibc where it is defined at 
all. From sysdeps/unix/sysv/linux/kernel-features.h in glibc 2.7 it 
appears that netlink support has been available in the kernel since 2.4.17 
. For modern kernels we can thus safely assume that netlink support will 
always be available. So in practice, the extern line will never be used. 
In that case it should be removed though to avoid further confusion.

I would therefore suggest that we simply set ASSUME_NETLINK_SUPPORT to 1 
at all times, and remove the extern stuff. What do you think?

/Ricard
--
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30
  --- PLEASE NOTE - I have moved - from F407 to F117 - PLEASE NOTE ---



More information about the uClibc mailing list