-
Bug
-
Resolution: Fixed
-
P3
-
6, 6u11
-
b13
-
generic, sparc
-
linux, solaris_9
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2160360 | 6u34 | Robert Mckenna | P2 | Closed | Fixed | b01 |
JDK-2226911 | 6u33 | Robert Mckenna | P3 | Resolved | Fixed | b34 |
public Socket(InetAddress address,
int port,
InetAddress localAddr,
int localPort)
cannot successfully complete on SuSE Linux. See attached for the test program.
The program does the following:
1) Start a test server and use Socket constructor Socket(InetAddress, int) to create a connection and send some data. Both server and client are closed.
2) Start another test server and use Socket constructor Socket(InetAddress, int, InetAddress, int) to create a connection and send some data.
It is observed that when an IPv6 address is used in step 2), the Socket creation fails with the following stack trace:
/java/re/j2se/6.0/archive/fcs/binaries/linux-i586/bin/java -classpath ~/tests IPv6SocketTest fe80:0:0:0:207:e9ff:fe62:7e18
java.net.BindException: Cannot assign requested address
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.Socket.bind(Socket.java:565)
at java.net.Socket.<init>(Socket.java:364)
at java.net.Socket.<init>(Socket.java:266)
at IPv6SocketTest.test2(IPv6SocketTest.java:105)
at IPv6SocketTest.main(IPv6SocketTest.java:149)
Exception during creating Socket object java.net.BindException: Cannot assign requested address
It is also found that if we skip step 1) (by commenting out test1() in main()), the Socket still cannot be created in step 2), but due to timeout instead.
Here is the network configuration:
eth0 Link encap:Ethernet HWaddr 00:07:E9:62:7E:18
inet addr:129.145.163.163 Bcast:129.145.163.255 Mask:255.255.254.0
inet6 addr: fe80::207:e9ff:fe62:7e18/64 Scope:Link
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5919400 errors:27 dropped:0 overruns:0 frame:27
TX packets:1425053 errors:1 dropped:0 overruns:0 carrier:1
collisions:348412 txqueuelen:1000
RX bytes:1694148885 (1615.6 Mb) TX bytes:242995518 (231.7 Mb)
Base address:0xcc00 Memory:ff8e0000-ff900000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:93462 errors:0 dropped:0 overruns:0 frame:0
TX packets:93462 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:17620957 (16.8 Mb) TX bytes:17620957 (16.8 Mb)
Here is the host information:
Linux d-usca22-163-163 2.6.4-52-smp #1 SMP Wed Apr 7 02:11:20 UTC 2004 i686 i686 i386 GNU/Linux
It is observed that the problem does not exist if an IPv4 address is used as an argument to the program, or if the program is executed on Solaris.
- backported by
-
JDK-2226911 IOException thrown when Socket tries to bind to an local IPv6 address on SuSE Linux
- Resolved
-
JDK-2160360 IOException thrown when Socket tries to bind to an local IPv6 address on SuSE Linux
- Closed
- duplicates
-
JDK-6800096 Scope ID issue with Socket.connect()
- Closed
- relates to
-
JDK-6543428 BindException when binding to a link-local address on Windows
- Closed
-
JDK-6206527 "cannot assign address" when binding ServerSocket on Suse 9
- Resolved
-
JDK-6521974 DatagramSocket cannot bind to a local IPv6 address on SuSE Linux
- Closed
-
JDK-6529807 Can't get data send to Linux IPv6 link-local address
- Closed