[Patches] [ python-Patches-845306 ] socketmodule.c: fix for platforms w/o IPV6 (i.e.Solaris 5.7)

SourceForge.net noreply at sourceforge.net
Wed Nov 19 13:37:00 EST 2003


Patches item #845306, was opened at 2003-11-19 13:36
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=845306&group_id=5470

Category: Modules
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthew Bachmann (matt979)
Assigned to: Nobody/Anonymous (nobody)
Summary: socketmodule.c: fix for platforms w/o IPV6 (i.e.Solaris 5.7)

Initial Comment:

Fixes Bug #818490

socketmodule.c will not compile on platforms without 
IPV6 support such as Solaris 5.7 because the AF_INET6 
and INET_ADDRSTRLEN are used outside the 
ENABLE_IPV6 guarded sections. 

For example (lines 2971-2977):

#ifndef ENABLE_IPV6
    if(af == AF_INET6) {
        PyErr_SetString(socket_error,
                "can't use AF_INET6, IPv6 is disabled");
        return NULL;
    }
#endif

The code is putting error checking in when IPV6 is not 
supported, but it is using the AF_INET6 define which 
does not exist on platforms w/o IPV6.  

I simply removed the block and let the check fall to the 
inet_pton call.

I'm not so clear as what to do w/ INET_ADDRSTRLEN
define because I'm not knowledgable about its history.
At least under Solaris, INET_ADDRSTRLEN along with 
INET6_ADDRSTRLEN only appear w/ IPV6 support.

In the patch, I simply substituted it with 16 which is the 
value.  Since its just the number of characters in a 
dotted IP address, it seems like it would be pretty 
constant accross platforms.

The diff given is against the r232 cvs tag.



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

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



More information about the Patches mailing list