Modify

Opened 9 years ago

Closed 9 years ago

Last modified 6 years ago

#11452 closed defect (fixed)

IPv6 issue on 82xx and 8339 on Ubuntu 14.04 / ElementaryOS Freya & Luna

Reported by: ralleon@… Owned by: ralleon@…
Priority: normal Milestone: 15.09
Component: Core Version:
Keywords: template_report ipv6 linux javabug Cc:

Description

What steps will reproduce the problem?

  1. autoremove JOSM. deleted all plugins
  2. (fresh) install JOSM 8109 from repository
  3. run josm 8109 from terminal (loads ok. download data ok)
  4. close josm 8109
  5. sudo apt-get install josm (upgrad to JOSM 8339)
  6. run josm 8339 (on terminal)
  7. got this error: "INFO: Detected useable IPv6 network, prefering IPv6 over IPv4." "WARNING: Failed to read MOTD. Exception was: java.net.SocketException: Network is unreachable"
  8. JOSM won't download any data from server (tried on 82xx and 83xx)
  9. autoremove JOSM 8339
  10. reinstall josm 8109. everything is fine.

Please provide any additional information below. Attach a screenshot if possible.

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2015-05-08 01:31:23
Last Changed Author: stoecker
Revision: 8339
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Relative URL: ^/trunk
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2015-05-07 17:30:43 +0200 (Thu, 07 May 2015)
Last Changed Rev: 8339

Identification: JOSM/1.5 (8339 en) Linux elementary OS Freya
Memory Usage: 175 MB / 875 MB (48 MB allocated, but free)
Java version: 1.7.0_79, Oracle Corporation, OpenJDK 64-Bit Server VM
Java package: openjdk-7-jre:amd64-7u79-2.5.5-0ubuntu0.14.04.2
VM arguments: [-Djosm.restart=true, -Djava.net.useSystemProxies=true]

Plugins:
- DirectDownload
- DirectUpload
- buildings_tools
- fieldpapers
- measurement
- photo_geotagging
- reverter
- turnrestrictions
- utilsplugin2

Last errors/warnings:
- W: Failed to read MOTD. Exception was: java.net.SocketException: Network is unreachable
- E: java.net.SocketException: Network is unreachable
- E: org.openstreetmap.josm.io.OsmTransferException: Could not connect to the OSM server. Please check your internet connection.. Cause: java.net.SocketException: Network is unreachable

Attachments (3)

update_JOSM_8109_to_8339.png (291.5 KB ) - added by anonymous 9 years ago.
IPv6Test.class (1.1 KB ) - added by stoecker 9 years ago.
Test-programm to test IPv6
IPv6Test.java (574 bytes ) - added by stoecker 8 years ago.
Source of test

Download all attachments as: .zip

Change History (30)

by anonymous, 9 years ago

comment:1 by stoecker, 9 years ago

Owner: changed from team to ralleon@…
Status: newneedinfo

Please describe your system and the steps you did. The message above should only ever appear for the second start of new JOSM version. Also it should also only appear when you have a working IPv6 network.

So:

  • How often did you start JOSM and was the message there always
  • How is it after a prefernce clean of newest version
  • Do you have IPv6 setup
  • Does it work?
  • What says "ping6 josm.openstreetmap.de"?
  • Do you maybe switch between a working and a non-working IPv6 network?
  • What says "/usr/bin/ifconfig"?

BTW: This should be self-healing - i.e. when it fails it should switch back to IPv4. Does this work?

comment:2 by stoecker, 9 years ago

Resolution: needinfo
Status: needinfoclosed

comment:3 by darwish.d.d@…, 9 years ago

Please reopen this issue.

Faced with the same confusing issue.
console output:

Using /usr/lib/jvm/java-8-oracle/bin/java to execute josm.
INFO: Detected useable IPv6 network, prefering IPv6 over IPv4.
WARNING: Failed to read MOTD. Exception was: java.net.SocketException: Network is unreachable
INFO: GET https://api.openstreetmap.org/api/capabilities... 
WARNING: java.net.SocketException: Network is unreachable
ERROR: java.net.SocketException: Network is unreachable
INFO: Message notifier active (checks every 5 minutes)
INFO: GET https://api.openstreetmap.org/api/capabilities... 
WARNING: Already here java.net.SocketException: Network is unreachable
WARNING: org.openstreetmap.josm.io.OsmApiInitializationException: org.openstreetmap.josm.io.OsmTransferException: java.net.SocketException: Network is unreachable. Cause: org.openstreetmap.josm.io.OsmTransferException: java.net.SocketException: Network is unreachable. Cause: java.net.SocketException: Network is unreachable
org.openstreetmap.josm.io.OsmApiInitializationException: org.openstreetmap.josm.io.OsmTransferException: java.net.SocketException: Network is unreachable
	at org.openstreetmap.josm.io.OsmApi.initialize(OsmApi.java:269)
	at org.openstreetmap.josm.io.OsmApi.initialize(OsmApi.java:195)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStream(OsmServerReader.java:66)
	at org.openstreetmap.josm.io.OsmServerUserInfoReader.fetchUserInfo(OsmServerUserInfoReader.java:172)
	at org.openstreetmap.josm.io.MessageNotifier$Worker.run(MessageNotifier.java:61)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.openstreetmap.josm.io.OsmTransferException: java.net.SocketException: Network is unreachable
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:727)
	at org.openstreetmap.josm.io.OsmApi$CapabilitiesCache.updateData(OsmApi.java:183)
	at org.openstreetmap.josm.io.CacheCustomContent.updateForce(CacheCustomContent.java:134)
	at org.openstreetmap.josm.io.CacheCustomContent.updateForceString(CacheCustomContent.java:146)
	at org.openstreetmap.josm.io.CacheCustomContent.updateIfRequiredString(CacheCustomContent.java:124)
	at org.openstreetmap.josm.io.OsmApi.initialize(OsmApi.java:213)
	... 11 more
Caused by: java.net.SocketException: Network is unreachable
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:656)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
	at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
	at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1104)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:998)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:657)
	... 16 more

version:

~$ josm --version
Using /usr/lib/jvm/java-8-oracle/bin/java to execute josm.
JOSM/1.5 (8491 en) Linux Ubuntu 14.04.2 LTS

network config:

~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:1c:c4:cf:6b:4a brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:1f:3c:07:39:f9 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.157/24 brd 192.168.1.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::21f:3cff:fe07:39f9/64 scope link 
       valid_lft forever preferred_lft forever

Have no proper IPv6 setup and it does't work.

Self-healing does't work transparently

comment:4 by anonymous, 9 years ago

I disable IPv6 by bollowed way:
Add to file /etc/sysctl.conf lines:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Activate it by sudo sysctl -p

After that I check cat /proc/sys/net/ipv6/conf/all/disable_ipv6
That return 1 (IPv6 disabled)

After that JOSM issue is gone

~$ josm
Using /usr/lib/jvm/java-8-oracle/bin/java to execute josm.
INFO: Detected no useable IPv6 network, prefering IPv4 over IPv6 after next restart.
INFO: GET https://api.openstreetmap.org/api/capabilities... 
INFO: OK
INFO: Message notifier active (checks every 5 minutes)
INFO: GET https://api.openstreetmap.org/api/0.6/user/details (get number of unread messages)

comment:5 by stoecker, 9 years ago

This ticket was closed as NEEDINFO, which means it's not fixed, but information was missing!

Text says: "INFO: Detected useable IPv6 network, prefering IPv6 over IPv4."

This text is caused by this code (stripped).

for (InetAddress a : InetAddress.getAllByName("josm.openstreetmap.de")) {
  if (a instanceof Inet6Address) {
    if (a.isReachable(1000)) {
      Main.info(tr("Detected useable IPv6 network, prefering IPv6 over IPv4."));
    }
  }
}

This means that only if resolving IPv6 address of josm.openstreetmap.de works and it's possible to connect that server the message appears.

If that messages appears on your system without IPv6 functionality, then something needs to intercept and act as if connection was ok. Please answer following:

  • What does host t josm.openstreetmap.de
  • What says host -t AAAA josm.openstreetmap.de
  • What says ping6 -c 3 josm.openstreetmap.de
  • What says ping -c 3 josm.openstreetmap.de
  • What says ping6 -c 3 ::1

All of the above with your fix reversed.

P.S. You can set "prefer.ipv6" to false in JOSM. No need to change system settings (thought that probably also fixes other issues non-fatal you may have :-)

If you know how to program Java a bit using the above code snipped and printing the values in each stage would be helpful as well.

Last edited 9 years ago by Don-vip (previous) (diff)

comment:6 by darwish.d.d@…, 9 years ago

I revert all changes above and perform commands

~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:1c:c4:cf:6b:4a brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:1f:3c:07:39:f9 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.157/24 brd 192.168.1.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::21f:3cff:fe07:39f9/64 scope link 
       valid_lft forever preferred_lft forever
~$ host t josm.openstreetmap.de
;; connection timed out; no servers could be reached
~$ host -t AAAA josm.openstreetmap.de
josm.openstreetmap.de has IPv6 address 2a01:4f8:d16:5ac6::2
ddarwish@dark-hp:~$ ping6 -c 3 josm.openstreetmap.de
PING josm.openstreetmap.de(josm.openstreetmap.de) 56 data bytes
From josm.openstreetmap.de icmp_seq=1 Destination unreachable: No route
From josm.openstreetmap.de icmp_seq=2 Destination unreachable: No route
From josm.openstreetmap.de icmp_seq=3 Destination unreachable: No route

--- josm.openstreetmap.de ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2002ms
~$ ping -c 3 josm.openstreetmap.de
PING josm.openstreetmap.de (78.47.79.181) 56(84) bytes of data.
64 bytes from josm.openstreetmap.de (78.47.79.181): icmp_seq=1 ttl=55 time=48.2 ms
64 bytes from josm.openstreetmap.de (78.47.79.181): icmp_seq=2 ttl=55 time=48.0 ms
64 bytes from josm.openstreetmap.de (78.47.79.181): icmp_seq=3 ttl=55 time=48.1 ms

--- josm.openstreetmap.de ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 48.090/48.161/48.213/0.051 ms
~$ ping6 -c 3 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.032 ms
64 bytes from ::1: icmp_seq=2 ttl=64 time=0.041 ms
64 bytes from ::1: icmp_seq=3 ttl=64 time=0.038 ms

--- ::1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.032/0.037/0.041/0.003 ms

Thanks for advice. I'll set "prefer.ipv6" to false.
I'm not a Java programmer (

by stoecker, 9 years ago

Attachment: IPv6Test.class added

Test-programm to test IPv6

comment:7 by stoecker, 9 years ago

Resolution: needinfo
Status: closedreopened

Hmm, looks all ok to me (note one of my commands had an additional "t", but that's not important :-) You have a working IPv4 and local network only IPv6. Question is why Java thinks otherwise.

Can you please download IPv6Test.class and start it with java IPv6Test and tell me the output?

Last edited 9 years ago by stoecker (previous) (diff)

comment:8 by mdk, 9 years ago

I'm not affected by the problem, but I try to run your test just for fun. The result looks not good:

michael@michael-CQ2710EZ:~/Downloads$ java IPv6Test 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Exception in thread "main" java.lang.ClassFormatError: Incompatible magic value 1008813135 in class file IPv6Test
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

I actually use this JOSM version:

Revision: 8607
Repository Root: http://josm.openstreetmap.de/svn
Relative URL: ^/trunk
Last Changed Author: wiktorn
Last Changed Date: 2015-07-16 21:55:32 +0200 (Thu, 16 Jul 2015)
Build-Date: 2015-07-17 01:32:09
URL: http://josm.openstreetmap.de/svn/trunk
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last Changed Rev: 8607

Identification: JOSM/1.5 (8607 en) Linux Ubuntu 15.04
Memory Usage: 235 MB / 878 MB (70 MB allocated, but free)
Java version: 1.8.0_45-internal, Oracle Corporation, OpenJDK Server VM
VM arguments: [-javaagent:/usr/share/java/jayatanaag.jar, -Djosm.restart=true, -Djosm.home=/home/michael/.josm-latest, -Djava.net.useSystemProxies=true]

Plugins:
- ColumbusCSV (31241)
- FastDraw (31265)
- HouseNumberTaggingTool (31241)
- OpeningHoursEditor (31241)
- RoadSigns (31241)
- SimplifyArea (31241)
- buildings_tools (31361)
- contourmerge (1013)
- imagery-xml-bounds (31241)
- imagery_offset_db (31241)
- pbf (31241)
- poly (31241)
- public_transport (31241)
- reltoolbox (31241)
- reverter (31241)
- terracer (31241)
- turnrestrictions (31241)
- utilsplugin2 (31241)

in reply to:  7 ; comment:9 by darwish.d.d@…, 9 years ago

I done it

$ java IPv6Test
Test josm.openstreetmap.de/78.47.79.181
Test josm.openstreetmap.de/2a01:4f8:d16:5ac6:0:0:0:2
IPV6 ok josm.openstreetmap.de/2a01:4f8:d16:5ac6:0:0:

in reply to:  9 comment:10 by stoecker, 9 years ago

Replying to darwish.d.d@…:

I done it

$ java IPv6Test
Test josm.openstreetmap.de/78.47.79.181
Test josm.openstreetmap.de/2a01:4f8:d16:5ac6:0:0:0:2
IPV6 ok josm.openstreetmap.de/2a01:4f8:d16:5ac6:0:0:

Fine, but no news - This only tells us what we already know, that Java is sure IPv6 is working. (I assume you forgot to C&P the last three characters?)

Can you please try following:

  • Login as superuser/root
  • Try not to cause network traffic somewhere else on the computer
  • Call following commandline (as root)
(tcpdump -v -n -i wlan0 &) ; sleep 1; java IPv6Test; sleep 1; killall tcpdump
  • This calls network sniffer tcpdump in background, then the testcase and then kills the sniffer.
  • If nothing is printed, then check if wlan0 is correct or another interface is used.
  • If too much non-related stuff is printed wait until these tasks are finished and try again.
  • Maybe you need to install tcpdump temporary to do so. Don't know if that's default.

You should get something like this (note this is an example of working IPv6 connection):

tcpdump: listening on p3p1, link-type EN10MB (Ethernet), capture size 65535 bytes
Test josm.openstreetmap.de/78.47.79.181
Test josm.openstreetmap.de/2a01:4f8:d16:5ac6:0:0:0:2
17:13:09.011017 IP6 (hlim 255, next-header ICMPv6 (58) payload length: 24) ... > 2a01:4f8:d16:5ac6::2: [icmp6 sum ok] ICMP6, echo request, seq 1
17:13:09.053632 IP6 (hlim 52, next-header ICMPv6 (58) payload length: 24) 2a01:4f8:d16:5ac6::2 > ...: [icmp6 sum ok] ICMP6, echo reply, seq 1
IPV6 ok josm.openstreetmap.de/2a01:4f8:d16:5ac6:0:0:0:2

2 packets captured
2 packets received by filter
0 packets dropped by kernel

in reply to:  8 comment:11 by stoecker, 9 years ago

Replying to mdk:

I'm not affected by the problem, but I try to run your test just for fun. The result looks not good:
Exception in thread "main" java.lang.ClassFormatError: Incompatible magic value 1008813135 in class file IPv6Test

That looks much like a download error. Try a tool which for sure does not modify file contents, e.g. wget.

comment:12 by darwish.d.d@…, 9 years ago

$ (sudo tcpdump -v -n -i wlan0 &); sleep 2; java IPv6Test; sleep 2; sudo killall tcpdump
tcpdump: listening on wlan0, link-type EN10MB (Ethernet), capture size 65535 bytes
Test josm.openstreetmap.de/78.47.79.181
Test josm.openstreetmap.de/2a01:4f8:d16:5ac6:0:0:0:2
IPV6 ok josm.openstreetmap.de/2a01:4f8:d16:5ac6:0:0:0:2

09:32:41.589587 IP6 (hlim 64, next-header TCP (6) payload length: 40)
  fe80::21f:3cff:fe07:39f9.48317 > 2a01:4f8:d16:5ac6::2.7: Flags [S], cksum 0xa3e6 (correct),
  seq 1440435425, win 28800, options [mss 1440,sackOK,TS val 247729 ecr 0,nop,wscale 7], length 0

09:32:41.592146 IP6 (hlim 255, next-header ICMPv6 (58) payload length: 32)
  fe80::6670:2ff:fea0:b868 > ff02::1:ff07:39f9: [icmp6 sum ok]
  ICMP6, neighbor solicitation, length 32, who has fe80::21f:3cff:fe07:39f9
	  source link-address option (1), length 8 (1): 64:70:02:a0:b8:68

09:32:41.592185 IP6 (hlim 255, next-header ICMPv6 (58) payload length: 32)
  fe80::21f:3cff:fe07:39f9 > fe80::6670:2ff:fea0:b868: [icmp6 sum ok]
  ICMP6, neighbor advertisement, length 32, tgt is fe80::21f:3cff:fe07:39f9, Flags [solicited, override]
	  destination link-address option (2), length 8 (1): 00:1f:3c:07:39:f9

09:32:41.593000 IP6 (hlim 64, next-header ICMPv6 (58) payload length: 88)
  fe80::6670:2ff:fea0:b868 > fe80::21f:3cff:fe07:39f9: [icmp6 sum ok]
  ICMP6, destination unreachable, unreachable route 2a01:4f8:d16:5ac6::2

27 packets captured
27 packets received by filter
0 packets dropped by kernel

Stripped the record to IPV6 data only and formated for better readability (Stoecker - 2015-10-21)

Last edited 8 years ago by stoecker (previous) (diff)

comment:13 by stoecker, 9 years ago

Ticket #11735 has been marked as a duplicate of this ticket.

comment:14 by stoecker, 9 years ago

Sorry for the long delay.

Issue is that Java says connection is ok when in reality it is "ICMP6, destination unreachable, unreachable route". Seems I can't trust the Java functions. I need to implement my own test to be sure connection works really.

comment:15 by stoecker, 9 years ago

Resolution: fixed
Status: reopenedclosed

In 8706/josm:

improve IPv6 check (workaround for bad data from Java) - fix #11452

comment:16 by Don-vip, 9 years ago

Keywords: ipv6 linux javabug added
Milestone: 15.09

by stoecker, 8 years ago

Attachment: IPv6Test.java added

Source of test

comment:17 by stoecker, 8 years ago

@Don-vip: Maybe that should be reported as Javabug?

comment:18 by Don-vip, 8 years ago

Yes :) I don't remember everyting on this ticket. If I understand well, your program should print "IPV6 ok " on a ipv6 enabled machine and it doesn't, right? Have you tried with latest Java (8u65/8u66) before I create the ticket? I will also need your system information (uname -a).

comment:19 by Don-vip, 8 years ago

I cannot test on my machine because my ISP does not provide IPv6 yet. I tried on JOSM server and it works, but I'm not sure if the loopback is used or not:

josm@josm:~$ java -cp . IPv6Test
Test josm.openstreetmap.de/78.47.79.181
Test josm.openstreetmap.de/2a01:4f8:d16:5ac6:0:0:0:2
IPV6 ok josm.openstreetmap.de/2a01:4f8:d16:5ac6:0:0:0:2
josm@josm:~$ uname -a
Linux josm.openstreetmap.de 3.13.0-53-generic #89-Ubuntu SMP Wed May 20 10:34:39 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
josm@josm:~$ java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)

comment:20 by stoecker, 8 years ago

Problem is reversed. It prints "IPV6 ok" in case it gets an "ICMP6, destination unreachable, unreachable route". Maybe they accept any ICMP6 as ok and not only the proper Echo Reply. I'm currently trying to find a description how that can be reached by an otherwise working IPv6 connection, to make testing easier.

comment:21 by Don-vip, 8 years ago

OK I have looked into further.

In your test example you should display the scope id as returned by Inet6Address#getScopeId() because it is involved in the algorithm.

The source code of Inet6AddressImpl#isReachable is here. In our case it is called with arguments ip, 1000, null, 0, so we're going to call the native method isReachable0 with arguments ip.getAddress(), scope, 1000, null, 0, -1.

The Unix implementation is here. It first calls ping6 if a Raw socket can be created, otherwise it tries to open a TCP connection on Echo port (7). If the connection is successful it returns true. The ping6 implementation is here. It sends a ICMP6_ECHO_REQUEST and expects only a ICMP6_ECHO_REPLY with the expected id. It also checks for address equality, I don't see anything obviously suspicious here. Maybe you do? I don't understand how it can succeed if it receives Destination Unreachable.

The Windows implementation is here. It just calls ping6. The ping6 implementation is here. The Windows implementation of ping6 is simpler: it only checks that a call to Icmp6SendEcho2 returns a value != 0.

Considering that Unix implementation defines its own ping6 mechanism, Windows implementation calls the operating system, and we have received only Linux bug reports, ping6 is definitely incriminated but I don't see how yet.

Last edited 8 years ago by stoecker (previous) (diff)

comment:22 by stoecker, 8 years ago

Hah - now I killed my IPv6 totally - probably I even need to reboot which would kill an uptime of 65 days :-( But I was yet unable to create an unreachable route request.

comment:23 by stoecker, 8 years ago

For me it tries TCP, so I assume the raw socket needs admin rights. We can probably assume that is the same for all reporters.

I think line 838 looks suspicious to me. ECONNREFUSED leads to an true. Probably that also covers the unreachable destination.

comment:24 by Don-vip, 7 years ago

ping (haha)

Things changed a bit on my side in the past 20 months, I finally have an IPv6 connection.

I will try it when I return home next week and create a bug report (and update JavaBugs) if I am able to reproduce.

comment:25 by Don-vip, 7 years ago

Ah, this is interesting. IPv6 support should finally improve in Java 10.

comment:26 by stoecker, 7 years ago

I finally have an IPv6 connection.

Welcome in the club ;-)

IPv6 support should finally improve in Java 10.

Let's hope. It really gets time. Java IPv6 support is awful.

comment:27 by Don-vip, 6 years ago

javabug:8179037 not modified for a whole year. It's not in Java 10, nor in 11, not planned yet :(

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain ralleon@….
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.