Issue 1008086: socket.inet_aton returns 8 bytes on LP64 platforms (original) (raw)

Created on 2004-08-12 16:50 by mwichmann, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
socketmod.patch mwichmann,2004-08-12 16:50
Messages (10)
msg46687 - (view) Author: Mats Wichmann (mwichmann) * Date: 2004-08-12 16:50
The attached is a fix for the same problem that is reported in 767150. For 2.3.x and head cvs this problem exists in the code path taken if configure does not detect inet_aton. I have not checked this against 2.2, which is the platform 767150 reports it against, there may be header inclusion issues that make it not work there but the essence is that the quantity worked with has to be forced to be a 32-bit quanitity, not declared unsigned long.
msg46688 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2007-03-11 18:53
The patch is only one line, changing a unsigned long to in_addr_t. Could someone familiar with/with access to Linux on an IA64 machine take a look at this? Thomas, I notice a lot of posts from you about 64-bit issues... ; )
msg81520 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-02-10 01:40
This is a patch for issue 767150, which was closed in 2005.
msg81522 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-02-10 02:22
I'm not sure in_addr_t is available everywhere. "unsigned int" should be a good bet, since it is 32-bits in most platforms. Guarding the code with a "#if (SIZEOF_INT == 4)" and erroring out otherwise will make the patch ok (and, please add a test).
msg81523 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-02-10 02:23
Sorry, reopening.
msg81687 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-02-11 23:04
Test from issue 767150: """ socket.inet_aton() returns an 8 byte string when built on Linux/IA64. This should be 4 bytes on all architectures. Example: >>> import socket >>> socket.inet_aton('192.168.2.1') '\xc0\xa8\x02\x01\x00\x00\x00\x00' """ The bug was confirmed by a third-party in 2006: http://mail.python.org/pipermail/python-list/2006-August/400655.html
msg81688 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2009-02-11 23:16
fixing now.
msg81691 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2009-02-11 23:47
fixed in trunk r69519. needs backporting to release26-maint and release30-maint. leaving open until that happens.
msg90272 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2009-07-08 16:13
Ping? This has been merged to py3k with r69560 and is present in 3.1, what about 2.6?
msg94803 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2009-11-01 20:30
Fixed in release26-maint r76022. This will appear in Python 2.6.5. I'm leaving release30-maint alone as it is already in 3.1. sorry for not making it into 2.6.3/2.6.4 despite the code being ready. I should've set this as a release blocker.
History
Date User Action Args
2022-04-11 14:56:06 admin set github: 40748
2009-11-01 20:30:04 gregory.p.smith set status: open -> closedresolution: fixedmessages: +
2009-07-08 16:13:22 amaury.forgeotdarc set nosy: + amaury.forgeotdarcmessages: +
2009-02-11 23:47:29 gregory.p.smith set keywords: + 64bit, - patchtype: behaviorversions: + Python 3.0messages: + title: patch for 767150 -> socket.inet_aton returns 8 bytes on LP64 platforms
2009-02-11 23:33:41 gregory.p.smith link issue767150 superseder
2009-02-11 23:16:20 gregory.p.smith set keywords: + easyassignee: twouters -> gregory.p.smithmessages: + nosy: + gregory.p.smith
2009-02-11 23:04:39 ajaksu2 set messages: +
2009-02-10 02:23:31 pitrou set status: closed -> openresolution: out of date -> (no value)messages: +
2009-02-10 02:22:54 pitrou set status: open -> closednosy: + pitrouresolution: out of datemessages: +
2009-02-10 01:40:25 ajaksu2 set nosy: + ajaksu2messages: +
2004-08-12 16:50:09 mwichmann create