summaryrefslogtreecommitdiff
path: root/java/openjdk8/files/patch-jdk-src-solaris-native-sun-nio-ch-sctp-SctpChannelImpl.c
blob: 226536edfcda5ecfece2f59e9c24e5221afd2f57 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c.org	2018-07-26 09:56:49.897172000 +0200
+++ jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c	2018-07-30 16:13:19.116935000 +0200
@@ -330,11 +330,11 @@
             break;
         case SCTP_ADDR_MADE_PRIM :
             event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_MADE_PRIM;
-#ifdef __linux__  /* Solaris currently doesn't support SCTP_ADDR_CONFIRMED */
+#ifndef __solaris__  /* Solaris currently doesn't support SCTP_ADDR_CONFIRMED */
             break;
         case SCTP_ADDR_CONFIRMED :
             event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_CONFIRMED;
-#endif  /* __linux__ */
+#endif  /* __solaris__ */
     }
 
     addressObj = SockAddrToInetSocketAddress(env, (struct sockaddr*)&spc->spc_aaddr);
@@ -445,13 +445,13 @@
             } else if (errno == EINTR) {
                 return IOS_INTERRUPTED;
 
-#ifdef __linux__
+#ifndef __solaris__
             } else if (errno == ENOTCONN) {
                 /* ENOTCONN when EOF reached */
                 rv = 0;
                 /* there will be no control data */
                 msg->msg_controllen = 0;
-#endif /* __linux__ */
+#endif /* __solaris__ */
 
             } else {
                 handleSocketError(env, errno);
@@ -568,7 +568,7 @@
     /* Set up the msghdr structure for sending */
     memset(msg, 0, sizeof (*msg));
     memset(cbuf, 0, cbuf_size);
-    msg->msg_name = &sa;
+    msg->msg_name = (sa_len == 0 ? NULL : &sa);
     msg->msg_namelen = sa_len;
     iov->iov_base = addr;
     iov->iov_len = length;