jdk/src/solaris/native/java/net/net_util_md.c
changeset 25170 f58832169add
parent 23033 0cc7c83fde3c
--- a/jdk/src/solaris/native/java/net/net_util_md.c	Wed Jun 25 18:49:02 2014 +0800
+++ b/jdk/src/solaris/native/java/net/net_util_md.c	Wed Jun 25 15:55:42 2014 +0100
@@ -1317,7 +1317,7 @@
      *    or sending UDP packet.
      * 2. IPv6 on Linux: By default Linux ignores flowinfo
      *    field so enable IPV6_FLOWINFO_SEND so that flowinfo
-     *    will be examined.
+     *    will be examined. We also set the IPv4 TOS option in this case.
      * 3. IPv4: set socket option based on ToS and Precedence
      *    fields (otherwise get invalid argument)
      */
@@ -1333,8 +1333,10 @@
 #if defined(AF_INET6) && defined(__linux__)
         if (ipv6_available()) {
             int optval = 1;
-            return setsockopt(fd, IPPROTO_IPV6, IPV6_FLOWINFO_SEND,
-                              (void *)&optval, sizeof(optval));
+            if (setsockopt(fd, IPPROTO_IPV6, IPV6_FLOWINFO_SEND,
+                           (void *)&optval, sizeof(optval)) < 0) {
+                return -1;
+            }
         }
 #endif