Message7168

Author amak
Recipients amak, oscar
Date 2012-05-29.22:09:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1338329380.31.0.934171399625.issue1895@psf.upfronthosting.co.za>
In-reply-to
Content
There's a couple of aspects to this.

First of all, the jython socket module is defaulting to AF_INET, when it should really be defaulting to AF_UNSPEC, which will return both 
IPv4 and IPv6 addresses. I.e. the signature of the function looks like this

def getaddrinfo(host, port, family=AF_INET, socktype=None, proto=0, flags=0):

and should look like this

def getaddrinfo(host, port, family=AF_UNSPEC, socktype=None, proto=0, flags=0):

I will fix this.

Also what needs to be fixed is returning all possible socket types and protocols, if they are not specified. I will fix this.

Even when the above two fixes are done, you will still not get the 6 results that cpython gives, because it has returned a SOCK_RAW address_info to you: java, and thus jython, does not support SOCK_RAW sockets.

And lastly, there are JVM options that control whether or not the address lookup calls return IPv4 or IPv6, which I will have to document, since they can also have a bearing on what results are returned from java.net.InetAddress.getAllByName()

I will check in these fixes, to 2.5 and 2.7, at the weekend.
History
Date User Action Args
2012-05-29 22:09:40amaksetmessageid: <1338329380.31.0.934171399625.issue1895@psf.upfronthosting.co.za>
2012-05-29 22:09:40amaksetrecipients: + amak, oscar
2012-05-29 22:09:40amaklinkissue1895 messages
2012-05-29 22:09:39amakcreate