[Python-bugs-list] [ python-Bugs-730222 ] socketmodule.c: inet_pton() expects 4-byte packed_addr
SourceForge.net
noreply@sourceforge.net
Wed, 30 Apr 2003 08:01:37 -0700
Bugs item #730222, was opened at 2003-04-30 11:00
Message generated for change (Settings changed) made by john_marshall
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=730222&group_id=5470
Category: Python Library
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: John Marshall (john_marshall)
Assigned to: Nobody/Anonymous (nobody)
>Summary: socketmodule.c: inet_pton() expects 4-byte packed_addr
Initial Comment:
In the Modules/socketmodule.c file, the inet_pton function
implicitly treats "long packed_addr" as a 4-byte object or
expects that the required 4-bytes is at
&packed_addr[0]-[3]. This is not true under
SUPER-UX/SX. In order to get this working right, I
changed the data type from "long" to "int". This now
works properly.
-----Modules/socketmodule.c: #3825
/* 042303; JM; this routine really expects a 4-byte
packed_addr
* not a long; long on SX is 8-bytes! */
#if SX
int packed_addr;
#else
long packed_addr;
#endif
...
if (packed_addr == INADDR_NONE)
return 0;
memcpy(dst, &packed_addr, 4);
-----
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=730222&group_id=5470