[Patches] [ python-Patches-845306 ] socketmodule.c: fix for
platforms w/o IPV6 (i.e.Solaris 5.7)
SourceForge.net
noreply at sourceforge.net
Fri Dec 5 14:40:16 EST 2003
Patches item #845306, was opened at 2003-11-19 13:36
Message generated for change (Comment added) made by matt979
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.
----------------------------------------------------------------------
>Comment By: Matthew Bachmann (matt979)
Date: 2003-12-05 14:40
Message:
Logged In: YES
user_id=912994
Sounds good. I guarded that code with:
#if ! defined(ENABLE_IPV6) && defined(AF_INET6)
Uploaded attached new patch.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2003-12-05 14:13
Message:
Logged In: YES
user_id=21627
The patch is incorrect: The block checking for AF_INET6
should not be removed. On some systems, AF_INET6 might be
available, and using it with disabled IPv6 should cause an
exception.
Instead, you should check whether AF_INET6 is defined also.
----------------------------------------------------------------------
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