src/solaris/native/java/net/net_util_md.c
Print this page
rev 8975 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests
*** 994,1008 ****
{ java_net_SocketOptions_SO_OOBINLINE, SOL_SOCKET, SO_OOBINLINE },
{ java_net_SocketOptions_SO_LINGER, SOL_SOCKET, SO_LINGER },
{ java_net_SocketOptions_SO_SNDBUF, SOL_SOCKET, SO_SNDBUF },
{ java_net_SocketOptions_SO_RCVBUF, SOL_SOCKET, SO_RCVBUF },
{ java_net_SocketOptions_SO_KEEPALIVE, SOL_SOCKET, SO_KEEPALIVE },
- #if defined(_AIX)
- { java_net_SocketOptions_SO_REUSEADDR, SOL_SOCKET, SO_REUSEPORT },
- #else
{ java_net_SocketOptions_SO_REUSEADDR, SOL_SOCKET, SO_REUSEADDR },
- #endif
{ java_net_SocketOptions_SO_BROADCAST, SOL_SOCKET, SO_BROADCAST },
{ java_net_SocketOptions_IP_TOS, IPPROTO_IP, IP_TOS },
{ java_net_SocketOptions_IP_MULTICAST_IF, IPPROTO_IP, IP_MULTICAST_IF },
{ java_net_SocketOptions_IP_MULTICAST_IF2, IPPROTO_IP, IP_MULTICAST_IF },
{ java_net_SocketOptions_IP_MULTICAST_LOOP, IPPROTO_IP, IP_MULTICAST_LOOP },
--- 994,1004 ----
*** 1283,1292 ****
--- 1279,1289 ----
*/
int
NET_SetSockOpt(int fd, int level, int opt, const void *arg,
int len)
{
+
#ifndef IPTOS_TOS_MASK
#define IPTOS_TOS_MASK 0x1e
#endif
#ifndef IPTOS_PREC_MASK
#define IPTOS_PREC_MASK 0xe0
*** 1303,1315 ****
#ifdef __APPLE__
static int maxsockbuf = -1;
#else
static long maxsockbuf = -1;
#endif
-
- int addopt;
- struct linger *ling;
#endif
/*
* IPPROTO/IP_TOS :-
* 1. IPv6 on Solaris/Mac OS: NOOP and will be set
--- 1300,1309 ----
*** 1477,1490 ****
*bufsize = 1024;
}
}
}
/*
* On Solaris, SO_REUSEADDR will allow multiple datagram
! * sockets to bind to the same port. The network jck tests
* for this "feature", so we need to emulate it by turning on
* SO_REUSEPORT as well for that combination.
*/
if (level == SOL_SOCKET && opt == SO_REUSEADDR) {
int sotype;
--- 1471,1486 ----
*bufsize = 1024;
}
}
}
+ #endif
+ #if defined(_ALLBSD_SOURCE) || defined(_AIX)
/*
* On Solaris, SO_REUSEADDR will allow multiple datagram
! * sockets to bind to the same port. The network jck tests check
* for this "feature", so we need to emulate it by turning on
* SO_REUSEPORT as well for that combination.
*/
if (level == SOL_SOCKET && opt == SO_REUSEADDR) {
int sotype;
*** 1494,1508 ****
if (getsockopt(fd, SOL_SOCKET, SO_TYPE, (void *)&sotype, &arglen) < 0) {
return -1;
}
if (sotype == SOCK_DGRAM) {
! addopt = SO_REUSEPORT;
! setsockopt(fd, level, addopt, arg, len);
}
}
-
#endif
return setsockopt(fd, level, opt, arg, len);
}
--- 1490,1502 ----
if (getsockopt(fd, SOL_SOCKET, SO_TYPE, (void *)&sotype, &arglen) < 0) {
return -1;
}
if (sotype == SOCK_DGRAM) {
! setsockopt(fd, level, SO_REUSEPORT, arg, len);
}
}
#endif
return setsockopt(fd, level, opt, arg, len);
}
*** 1668,1678 ****
newTime = JVM_CurrentTimeMillis(env, 0);
timeout -= (newTime - prevTime);
if (timeout <= 0) {
return read_rv > 0 ? 0 : -1;
}
! newTime = prevTime;
if (read_rv > 0) {
break;
}
--- 1662,1672 ----
newTime = JVM_CurrentTimeMillis(env, 0);
timeout -= (newTime - prevTime);
if (timeout <= 0) {
return read_rv > 0 ? 0 : -1;
}
! prevTime = newTime;
if (read_rv > 0) {
break;
}