Community
Participate
Working Groups
Created attachment 167950 [details] Screen shot showing stack and variable values. I'm getting an ArrayIndexOutOfBounds exception in LocatorService.Subnet.contains. It looks like it is running into trouble comparing an Inet4Address with an Inet6Address. See the attached screen shot for more details. I would attempt a fix but I'm not sure exactly how this is supposed to work.
I have committed a fix. I don't have Windows 7, so I tested it on Windows XP with IP V6 installed. Thanks.
Eugene, I'm having a problem with the fix on Windows 7. See the attached screenshot: at line 510 the buf length is 16. Consequently the subnet isn't added and my client on the local machine doesn't get the peer added notification.
Created attachment 168285 [details] buf contents
(In reply to comment #2) > Eugene, I'm having a problem with the fix on Windows 7. See the attached > screenshot: at line 510 the buf length is 16. Consequently the subnet isn't > added and my client on the local machine doesn't get the peer added > notification. Hi Ken, TCF discovery works only over IPv4 subnets. IPv6 is not supported yet. The fix addresses the exception that happens when both IPv4 and IPv6 installed - which, I think, is default for Windows 7, but it was not meant to provide full IPv6 support. And such support is not really necessary as long as IPv4 is available. Is IPv4 enabled on your machine? Is firewall turned off?
(In reply to comment #4) > (In reply to comment #2) > > Eugene, I'm having a problem with the fix on Windows 7. See the attached > > screenshot: at line 510 the buf length is 16. Consequently the subnet isn't > > added and my client on the local machine doesn't get the peer added > > notification. > > Hi Ken, > > TCF discovery works only over IPv4 subnets. IPv6 is not supported yet. > > The fix addresses the exception that happens when both IPv4 and IPv6 installed > - which, I think, is default for Windows 7, but it was not meant to provide > full IPv6 support. And such support is not really necessary as long as IPv4 is > available. > > Is IPv4 enabled on your machine? > Is firewall turned off? I'm running Windows 7 with IPv6 disabled. It is enabled by default on Win 7, but I get the same results with it enabled. The firewall is off. If I launch the C based TCF reference agent it's services are discovered correctly, it is only when I launch my Java based agent that I have this problem. I'll keep digging and see if I can find out more. Prior to this change I was able to discover the agent, I assume because it created a subnet for the IPv6 address.
I've worked around the last issue I mentioned. Marking this fixed as the exception no longer occurs.
Found another case where this exception occurs. On Windows 7 again, this time with ipv6 enabled. See the screen shot: a1 and a2 are equal but the subnet's prefix length is 128.
Created attachment 169060 [details] screenshot showing variable values
Created attachment 169061 [details] suggested patch Checking the array contents would be a good start, but if they are not equal you could still get the exception.
The patch does not address the root problem: 128 is invalid value for network_prefix_len of a IPv4 network address. I have searched Java bug database, and found that it is a known problem: InterfaceAddress.getNetworkPrefixLength() does not conform to Javadoc http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6707289 The bug shows up only when IPv6 is enabled. Unfortunately, it looks like the bug is not fixed in Java 1.6. We need to come up with a workaround for broken InterfaceAddress.getNetworkPrefixLength().
I have committed a (partial) workaround. It assumes network prefix length 24 if getNetworkPrefixLength() returns invalid value. If anyone has better workaround, please contribute it.
*** Bug 313778 has been marked as a duplicate of this bug. ***
Fixed. For details, see bug 318260: https://bugs.eclipse.org/bugs/show_bug.cgi?id=318260
Comment on attachment 169061 [details] suggested patch Marking patch obsolete since it was not used.
Moving bugs to new home for IP log.
Bulk change: Marking all bugs from the TM era (until June 2011) target 0.3