Request for Review: 6905552
Christopher Hegarty - Sun Microsystems Ireland
Christopher.Hegarty at Sun.COM
Wed Jan 27 07:21:19 PST 2010
On 27/01/2010 14:55, Alan Bateman wrote:
> Christopher Hegarty - Sun Microsystems Ireland wrote:
>> Hi Alan, Michael,
>>
>> Since we don't typically build on non-IPv6 systems, over a number of
>> years the net/nio code has not maintained clean non-IPv6 code. This
>> patch addresses that by excluding IPv6 specific code where AF_INET6 is
>> not defined.
>>
>> 6905552: libnet/nio portability issues
>>
>> Webrev: http://cr.openjdk.java.net/~chegar/6905552/webrev.0/webrev/
>>
>> -Chris.
> This looks okay to me. One thing I don't understand is the change to the
> getMTU method in src/solaris/native/java/net/NetworkInterface.c - it
> looks like this will fail on Solaris if IPv6 is not enabled - do I have
> this right? In the same place there the comment "Try wIth an ..." can
> probably be used.
What we found is that on Solaris if an interface has only IPv6 addresses
assigned to it, then you need to use a socket created with AF_INET6 when
querying the ioclt. By default, we always try to with an AF_INET socket
first and on Solaris fall back to try with an AF_INET6 socket if that
fails (see L1533 in the new file).
In the case that we are building without AF_INET6 defined it doesn't
make sense to try with an AF_INET6 socket if the ioctl fails with
AF_INET. Make sense? Is this what you were asking about?
> Minor comment is that there are a few inconsistencies in the comments.
> In some places it's #endif /* AF_INET6 */, others it is #endif //
> AF_INET6, and no comments in the rest.
I'll make the comment consistent. I only added a comment in cases where
I thought it was not obvious what the endif was for.
Thanks,
-Chris.
>
> -Alan.
More information about the net-dev
mailing list