[Patches] [ python-Patches-730603 ] socketmodule inet_ntop built when IPV6 is disabled

SourceForge.net noreply@sourceforge.net
Wed, 14 May 2003 20:56:58 -0700


Patches item #730603, was opened at 2003-05-01 15:05
Message generated for change (Comment added) made by cjohns
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=730603&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris Johns (cjohns)
Assigned to: Nobody/Anonymous (nobody)
Summary: socketmodule inet_ntop built when IPV6 is disabled

Initial Comment:
RTEMS does not support IPV6 and so does not define
ENABLE_IPV6 for Python.

RTEMS contains an aging port of the FreeBSD stack and
the port contains some IPV6 things such as inet_ntop
and inet_pton. This causes HAVE_INET_PTON to be defined
to 1 causing the current socketmodule.c to compile the
socket_inet_ntop code. The assumption being these
functions are only present with IPV6 stacks. This
assumption is valid, how-ever RTEMS breaks this
assuption and fixing this in RTEMS is not pratical.

Removing the HAVE_INET_PTON definition causes
socketmodule.c to compile in a private version. The
private versions have a slightly different prototype to
RTEMS and so the compiler stops with an error.

This patch seems the simplest solutions given it does
not effect other platforms.


----------------------------------------------------------------------

>Comment By: Chris Johns (cjohns)
Date: 2003-05-15 13:56

Message:
Logged In: YES 
user_id=197074

I have tested socketmodule.c version 1.268 with RTEMS and it
compiles and works.  No further changes are needed.

I added to RTEMS the INET_ADDRSTRLEN define as it was not in
netinet/in.h and the addition took a little longer than
expected.

An RTEMS maintainer raised the point the SUS standard that
defines INET_ADDRSTRLEN is new(ish!) and so Python may not
be as robust on older systems that do not have
INET_ADDRSTRLEN defined.

Thanks for the prompt resolution.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-05-10 17:44

Message:
Logged In: YES 
user_id=21627

I believe this patch is now superceded by #734231. It
appears that the problem of inet_pton is shared on many
platforms, so the code now wraps the buffer declaration with
ENABLE_IPV6.

Can you please retry the current CVS, and indicate whether
further changes are needed?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=730603&group_id=5470