< prev index next >

src/java.base/unix/native/libnet/PlainSocketImpl.c

Print this page

        

*** 44,53 **** --- 44,55 ---- jfieldID psi_timeoutID; jfieldID psi_trafficClassID; jfieldID psi_fdLockID; jfieldID psi_closePendingID; + extern void setDefaultScopeID(JNIEnv *env, struct sockaddr *him); + /* * file descriptor used for dup2 */ static int marker_fd = -1;
*** 257,266 **** --- 259,269 ---- /* connect */ if (NET_InetAddressToSockaddr(env, iaObj, port, &sa, &len, JNI_TRUE) != 0) { return; } + setDefaultScopeID(env, &sa.sa); if (trafficClass != 0 && ipv6_available()) { NET_SetTrafficClass(&sa, trafficClass); }
*** 504,513 **** --- 507,517 ---- /* bind */ if (NET_InetAddressToSockaddr(env, iaObj, localport, &sa, &len, JNI_TRUE) != 0) { return; } + setDefaultScopeID(env, &sa.sa); if (NET_Bind(fd, &sa, len) < 0) { if (errno == EADDRINUSE || errno == EADDRNOTAVAIL || errno == EPERM || errno == EACCES) { NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "BindException",
< prev index next >