Ticket #287: nginx-1.12.1-ip_transparent.patch
| File nginx-1.12.1-ip_transparent.patch, 3.0 KB (added by , 9 years ago) |
|---|
-
src/core/ngx_connection.c
a b ngx_open_listening_sockets(ngx_cycle_t * 497 497 } 498 498 #endif 499 499 500 #if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT) 501 502 if (ls[i].transparent) { 503 int transparent; 504 505 transparent = (ls[i].transparent == 1); 506 507 if (setsockopt(s, SOL_IP, IP_TRANSPARENT, 508 (const void *) &transparent, sizeof(int)) 509 == -1) 510 { 511 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, 512 "setsockopt(IP_TRANSPARENT) for %V failed, " 513 "ignored", 514 &ls[i].addr_text); 515 } 516 } 517 #endif 518 500 519 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) 501 520 502 521 if (ls[i].sockaddr->sa_family == AF_INET6) { -
src/core/ngx_connection.h
a b struct ngx_listening_s { 87 87 int fastopen; 88 88 #endif 89 89 90 #if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT) 91 unsigned transparent:1; 92 #endif 93 90 94 }; 91 95 92 96 -
src/http/ngx_http.c
a b ngx_http_add_listening(ngx_conf_t *cf, n 1745 1745 ls->sndbuf = addr->opt.sndbuf; 1746 1746 1747 1747 ls->keepalive = addr->opt.so_keepalive; 1748 1749 #if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT) 1750 ls->transparent = addr->opt.transparent; 1751 #endif 1752 1748 1753 #if (NGX_HAVE_KEEPALIVE_TUNABLE) 1749 1754 ls->keepidle = addr->opt.tcp_keepidle; 1750 1755 ls->keepintvl = addr->opt.tcp_keepintvl; -
src/http/ngx_http_core_module.c
a b ngx_http_core_listen(ngx_conf_t *cf, ngx 4101 4101 continue; 4102 4102 } 4103 4103 4104 if (ngx_strcmp(value[n].data, "transparent") == 0) { 4105 #if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT) 4106 lsopt.transparent = 1; 4107 #else 4108 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 4109 "transparent mode is not supported " 4110 "on this platform, ignored", 4111 &value[n]); 4112 #endif 4113 continue; 4114 } 4115 4104 4116 if (ngx_strncmp(value[n].data, "ipv6only=o", 10) == 0) { 4105 4117 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) 4106 4118 struct sockaddr *sa; -
src/http/ngx_http_core_module.h
a b typedef struct { 81 81 unsigned reuseport:1; 82 82 unsigned so_keepalive:2; 83 83 unsigned proxy_protocol:1; 84 #if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT) 85 unsigned transparent:1; 86 #endif 84 87 85 88 int backlog; 86 89 int rcvbuf; -
auto/unix
a b if [ $ngx_found = no ]; then 300 300 fi 301 301 302 302 303 ngx_feature="IP_TRANSPARENT" 304 ngx_feature_name="NGX_HAVE_TRANSPARENT" 305 ngx_feature_run=no 306 ngx_feature_incs="#include <sys/socket.h> 307 #include <netinet/in.h>" 308 ngx_feature_path= 309 ngx_feature_libs= 310 ngx_feature_test="setsockopt(0, SOL_IP, IP_TRANSPARENT, NULL, 0)" 311 . auto/feature 312 313 303 314 ngx_feature="SO_SETFIB" 304 315 ngx_feature_name="NGX_HAVE_SETFIB" 305 316 ngx_feature_run=no
