Re: TTL ignored when sending Multicast UDP Datagram to IPv4 address via IPv6 socket
Don Coleman wrote: I'm have a problem setting TTL when sending Multicast packets to an IPv4 address over an IPv6 socket. Setting the TTL in Java has no effect when sending to an IPv4 address. It is always 1. This is only a problem on Linux, it works fine on OS X, Solaris and Windows. This problem exists with JDK5, but it looks like it's also in the JDK7 code. https://openjdk.dev.java.net/source/browse/openjdk/jdk/trunk/j2se/src/solaris/native/java/net/PlainDatagramSocketImpl.c?annotate=237 on line 1873 IPV6_MULTICAST_HOPS is set for Linux I think we need also need to set IP_MULTICAST_TTL I've attached sample Java and C code that demonstrates the problem here https://bugs.launchpad.net/ubuntu/+bug/112257 Any thoughts if this is a Java problem or a Linux kernel bug? The bug tracking this one is: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6250763 At least in older kernels, it wasn't possible to set IPv4 multicast options on IPv6 sockets (the setsockopt would fail). Edward Wang has been testing with recent kernels and has results that suggest that setting the IPv4 options work now. I believe he has a fix/patch in the works to address this (Edward - can you comment?). If you need a workaround then run with -Djava.net.preferIPv4Stack=true so that all sockets are IPv4 (even if the machine has IPv6 enabled). -Alan.
Re: Request for comments: Bug 6306820
Richard Kennard <[EMAIL PROTECTED]> writes: > > Dear All, > > Please find the latest version of URLEncodedQueryString at... > > > https://jdk-collaboration.dev.java.net/ [snip] > Thanks again for all your help, and I look forward to hearing from you, Hi Richard, a small meta-comment: URLs to the jdk-collaboration site will only be visible to members of that project, i.e. not to all OpenJDK developers. cheers, dalibor topic
Re: Request for comments: Bug 6306820
Michael, Alan, Please find a new version of UrlEncodedQueryString up at: https://jdk-collaboration.dev.java.net/servlets/ProjectForumMessageView?messageID=20206&forumID=1463 Changes include: 1. Renamed to UrlEncodedQueryString instead of URLEncodedQueryString 2. Removed use of java.net.URL 3. Renamed ParameterSeparator enum to Separator 4. Changed toString to never return null, only an empty String I hope this means we can get it through the CCC in time for its two year anniversary :) Regards, Richard.
Re: TTL ignored when sending Multicast UDP Datagram to IPv4 address via IPv6 socket
-Djava.net.preferIPv4Stack=true works fine for IPv4, but my application needs to send both IPv4 and IPv6. I'd be interested to see Edward Wang's patch for this issue. On 6/1/07, Alan Bateman <[EMAIL PROTECTED]> wrote: Don Coleman wrote: > I'm have a problem setting TTL when sending Multicast packets to an > IPv4 address over an IPv6 socket. > > Setting the TTL in Java has no effect when sending to an IPv4 address. > It is always 1. > > This is only a problem on Linux, it works fine on OS X, Solaris and > Windows. > > This problem exists with JDK5, but it looks like it's also in the JDK7 > code. > > https://openjdk.dev.java.net/source/browse/openjdk/jdk/trunk/j2se/src/solaris/native/java/net/PlainDatagramSocketImpl.c?annotate=237 > > > on line 1873 IPV6_MULTICAST_HOPS is set > for Linux I think we need also need to set IP_MULTICAST_TTL > > I've attached sample Java and C code that demonstrates the problem > here https://bugs.launchpad.net/ubuntu/+bug/112257 > > Any thoughts if this is a Java problem or a Linux kernel bug? The bug tracking this one is: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6250763 At least in older kernels, it wasn't possible to set IPv4 multicast options on IPv6 sockets (the setsockopt would fail). Edward Wang has been testing with recent kernels and has results that suggest that setting the IPv4 options work now. I believe he has a fix/patch in the works to address this (Edward - can you comment?). If you need a workaround then run with -Djava.net.preferIPv4Stack=true so that all sockets are IPv4 (even if the machine has IPv6 enabled). -Alan.
Re: Request for comments: Bug 6306820
Dalibor, Fair point. I am only following the original advice of the Peabody initiative to use http://jdk-collaboration, and the more recent advice of the OpenJDK project to use the net-dev mailing list. If there is a new preference I am happy to switch to that? Richard. Dalibor Topic wrote: Richard Kennard <[EMAIL PROTECTED]> writes: Dear All, Please find the latest version of URLEncodedQueryString at... https://jdk-collaboration.dev.java.net/ [snip] Thanks again for all your help, and I look forward to hearing from you, Hi Richard, a small meta-comment: URLs to the jdk-collaboration site will only be visible to members of that project, i.e. not to all OpenJDK developers. cheers, dalibor topic