Issue2078

classification
Title: socket.getsockname() returns ipv6 name for ipv4 family when binding on ipaddr_any
Type: Severity: normal
Components: Core Versions: Jython 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: amak Nosy List: amak, irmen
Priority: Keywords:

Created on 2013-08-26.15:50:22 by irmen, last changed 2013-09-08.13:30:52 by irmen.

Messages
msg8090 (view) Author: Irmen de Jong (irmen) Date: 2013-08-26.15:50:22
When creating an ipv4 socket and binding it on ipaddr_any, getsockname returns an ipv6 address:

>>> s=socket(AF_INET, SOCK_STREAM)
>>> s.bind(("",0))
>>> s.listen(1)
>>> s.getsockname()
(u'0:0:0:0:0:0:0:0', 58526)

Expected behavior: return the ipv4 address "0.0.0.0" instead.
msg8105 (view) Author: Alan Kennedy (amak) Date: 2013-09-07.13:34:06
Hi Irmen.

I am not able to reproduce this on my local setup.

What version of jython is this happening on?
What java version?
What operating system?
msg8109 (view) Author: Irmen de Jong (irmen) Date: 2013-09-08.13:30:52
Happens with jython trunk (2.7b1+).
Happens on Windows 7 (java 1.7) and OS X 10.8.4 (java 1.6).
Both machines have a functional IPV6 (and IPV4) network address assigned.
History
Date User Action Args
2013-09-08 13:30:52irmensetmessages: + msg8109
2013-09-07 13:34:07amaksetassignee: amak
messages: + msg8105
nosy: + amak
2013-08-26 16:01:06irmensetcomponents: + Core
versions: + Jython 2.7
2013-08-26 15:50:22irmencreate