IPv4 socket bind using IPv6 socket on openjdk6 breaks udp send

Steven Hartland killing at multiplay.co.uk
Mon Jun 27 11:46:34 UTC 2011


----- Original Message ----- 
From: "Matthias Andree" <matthias.andree at gmx.de>
>> No I'm not its replying to the sender. 
> 
> Yes you are, check your trace: The sendto address and port are the same
> as the bound address.

This is a bug in truss it seems, Bjoern said he's gonna have a look at
it. Doesn't matter what you bind to it always reports this value in the
truss output.

>> In the java code we have:-
>> socket.send( new DatagramPacket( data, data.length,
>> src.getSocketAddress() ) );
>> Where src is the src packet. This works fine on IPv4 only machines and
>> when the jdk is told to use only IPv4 stack. So its not a problem with
>> the java code itself but could well be an issue with the
> 
> What data type is it?

All mute as the Bjoern found and fixed the issue, it was a bug in the
kernel fixed by:-
http://svnweb.freebsd.org/base?view=revision&revision=220463

>> Oops sorry cut and paste error (wrong line) heres the correct line.
>> root     java       894   20 udp4   85.236.109.212:25675  *:*
> 
> While a datagram socket, it does not match the socket()/bind() above.
> 
> An INET6-domain datagram socket would be listed as udp6 here.  Are you
> sure you're tracing the right VM and are looking at the right thread?

Again, truss isn't showing the correct results, confused me too ;-)

Possibly another bug in sockstat / netstat as well, when the socket is a
IPv6 socket bound to an IPv4 address maybe it should indicate this e.g.
udp6-4 instead of either udp4 or udp6; alternatively maybe udp6 + a IPv4
address is enough to indicate this, but that could cause confusion.

Thanks for looking at this, appreciated :)

    Regards
    Steve

================================================
This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 

In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337
or return the E.mail to postmaster at multiplay.co.uk.



More information about the freebsd-hackers mailing list