JDK-8048212 : Two tests failed with "java.net.SocketException: Bad protocol option" on Windows after 8029607
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2014-06-26
  • Updated: 2016-06-13
  • Resolved: 2014-07-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 JDK 9
7u80Fixed 8u40Fixed 9 b23Fixed
Related Reports
Relates :  
Description
TESTFAIL:java/nio/channels/DatagramChannel/SocketOptionTests.java
TESTFAIL:java/net/Socket/TrafficClass.java

Above two tests failed on windows since the fix of JDK-8029607.

java/nio/channels/DatagramChannel/SocketOptionTests.java log:
----------System.err:(15/826)----------
java.net.SocketException: Bad protocol option: no further information
	at sun.nio.ch.Net.setIntOption0(Native Method)
	at sun.nio.ch.Net.setSocketOption(Net.java:356)
	at sun.nio.ch.DatagramChannelImpl.setOption(DatagramChannelImpl.java:203)
	at SocketOptionTests.main(SocketOptionTests.java:95)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:484)
	at com.sun.javatest.regtest.MainAction$SameVMRunnable.run(MainAction.java:759)
	at java.lang.Thread.run(Thread.java:745)

test failed at this line -->  dc.setOption(IP_TOS, 0x08);     // can't check

java/net/Socket/TrafficClass.java log:
----------System.err:(14/819)----------
testDatagramSocket failed: java.net.SocketException: Bad protocol option: no further information
testSocket failed: java.net.SocketException: Bad protocol option: no further information
java.lang.Exception: 2 sub-test(s) failed - see log for details.
	at TrafficClass.main(TrafficClass.java:76)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:484)
	at com.sun.javatest.regtest.MainAction$SameVMRunnable.run(MainAction.java:759)
	at java.lang.Thread.run(Thread.java:745)


Comments
Net.c needs to look for IPv6 version of option and convert it back to the IPv4 one.
30-06-2014