comparison src/solaris/native/sun/nio/ch/Net.c @ 2653:1f996198877b

6882910: Unexplained lack of IP4 network ability when transparent IP6 to IP4 is disabled. Reviewed-by: alanb
author chegar
date Tue, 10 Aug 2010 17:30:43 +0100
parents 00cd9dc3c2b5
children 871cffb21423
comparison
equal deleted inserted replaced
6:90ef61d6b58c 7:57e6ec021844
168 168
169 fd = socket(domain, type, 0); 169 fd = socket(domain, type, 0);
170 if (fd < 0) { 170 if (fd < 0) {
171 return handleSocketError(env, errno); 171 return handleSocketError(env, errno);
172 } 172 }
173
174 #ifdef AF_INET6
175 /* Disable IPV6_V6ONLY to ensure dual-socket support */
176 if (domain == AF_INET6) {
177 int arg = 0;
178 if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&arg,
179 sizeof(int)) < 0) {
180 JNU_ThrowByNameWithLastError(env,
181 JNU_JAVANETPKG "SocketException",
182 "sun.nio.ch.Net.setIntOption");
183 close(fd);
184 return -1;
185 }
186 }
187 #endif
188
173 if (reuse) { 189 if (reuse) {
174 int arg = 1; 190 int arg = 1;
175 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&arg, 191 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&arg,
176 sizeof(arg)) < 0) { 192 sizeof(arg)) < 0) {
177 JNU_ThrowByNameWithLastError(env, 193 JNU_ThrowByNameWithLastError(env,