Mercurial > hg > nginx
comparison src/event/ngx_event_connect.c @ 7217:8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
On some platforms (for example, Linux with glibc 2.12-2.25) IPv4 transparent
proxying is available, but IPv6 transparent proxying is not. The entire feature
is enabled in this case and NGX_HAVE_TRANSPARENT_PROXY macro is set to 1.
Previously, an attempt to enable transparency for an IPv6 socket was silently
ignored in this case and was usually followed by a bind(2) EADDRNOTAVAIL error
(ticket #1487). Now the error is generated for unavailable IPv6 transparent
proxy.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Thu, 22 Feb 2018 13:16:21 +0300 |
parents | 56fc55e32f23 |
children | 91ea68dd1501 |
comparison
equal
deleted
inserted
replaced
7216:aa60f5799a4c | 7217:8b70d4caa505 |
---|---|
386 ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, | 386 ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, |
387 "setsockopt(IPV6_BINDANY) failed"); | 387 "setsockopt(IPV6_BINDANY) failed"); |
388 return NGX_ERROR; | 388 return NGX_ERROR; |
389 } | 389 } |
390 | 390 |
391 #endif | 391 #else |
392 | |
393 ngx_log_error(NGX_LOG_ALERT, pc->log, 0, | |
394 "could not enable transparent proxying for IPv6 " | |
395 "on this platform"); | |
396 | |
397 return NGX_ERROR; | |
398 | |
399 #endif | |
400 | |
392 break; | 401 break; |
393 | 402 |
394 #endif /* NGX_HAVE_INET6 */ | 403 #endif /* NGX_HAVE_INET6 */ |
395 | 404 |
396 } | 405 } |