comparison src/core/ngx_connection.c @ 2562:c352c419be85

ipv6only
author Igor Sysoev <igor@sysoev.ru>
date Fri, 13 Mar 2009 14:20:34 +0000
parents a7443674e429
children d43d73277c5c
comparison
equal deleted inserted replaced
2561:2c3cff5999a2 2562:c352c419be85
280 } 280 }
281 281
282 return NGX_ERROR; 282 return NGX_ERROR;
283 } 283 }
284 284
285 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
286
287 if (ls[i].sockaddr->sa_family == AF_INET6 && ls[i].ipv6only) {
288 int ipv6only;
289
290 ipv6only = (ls[i].ipv6only == 1);
291
292 if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
293 (const void *) &ipv6only, sizeof(int))
294 == -1)
295 {
296 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno,
297 "setsockopt(IPV6_V6ONLY) %V failed, ignored",
298 &ls[i].addr_text);
299 }
300 }
301 #endif
285 /* TODO: close on exit */ 302 /* TODO: close on exit */
286 303
287 if (!(ngx_event_flags & NGX_USE_AIO_EVENT)) { 304 if (!(ngx_event_flags & NGX_USE_AIO_EVENT)) {
288 if (ngx_nonblocking(s) == -1) { 305 if (ngx_nonblocking(s) == -1) {
289 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, 306 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,