[Python-Dev] cvs socketmodule.c and IPV6 disabled

Chris Johns cjohns@cybertec.com.au
Wed, 30 Apr 2003 15:10:50 +1000

Chris Johns wrote:
> Martin v. Lvwis wrote:
>> I see. And the system does have inet_pton? *That* sounds like a bug to 
>> me - there should be no inet_pton if the IPv6 API is unsupported.
> Agreed. I will disable them.

I disabled HAVE_INET_PTON in the pyconfig.h although the functions are present in the 
RTEMS header files as suggested. This throws up another error. When disabled the 
inet_pton and inet_ntop funtions in socketmodule.c are built. The RTEMS prototypes 
and the ones provided in socketmodule.c are not extactly the same giving a compile 
time error.

The RTEMS history is the IP stack is a port of the FreeBSD stack from a while ago. It 
must have some IPV6 things how-ever as far as I know is not working on RTEMS. I 
suspect it is not complete/current.

I feel the best solution is to define HAVE_INET_PTON in pyconfig.h.

>> So I think the configure test should be changed to define HAVE_PTON 
>> only if all prerequisites of its usage are met (or the entire function 
>> should be hidden if IPv6 is disabled).
> It would make Python more robust, but this is a mistake on my part.

I wrapped 'socket_inet_pton' and friend with ENABLE_IPV6 and sockets under RTEMS work.

  Chris Johns, cjohns at cybertec.com.au