Ticket #287: nginx-ip_transparent.patch
| File nginx-ip_transparent.patch, 4.0 KB (added by , 13 years ago) |
|---|
-
src/core/ngx_connection.c
old new ngx_open_listening_sockets(ngx_cycle_t * 334 334 return NGX_ERROR; 335 335 } 336 336 337 #if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT) 338 339 if (ls[i].transparent) { 340 int transparent; 341 342 transparent = (ls[i].transparent == 1); 343 344 if (setsockopt(s, SOL_IP, IP_TRANSPARENT, 345 (const void *) &transparent, sizeof(int)) 346 == -1) 347 { 348 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, 349 "setsockopt(IP_TRANSPARENT) for %V failed, " 350 "ignored", 351 &ls[i].addr_text); 352 } 353 } 354 #endif 355 337 356 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) 338 357 339 358 if (ls[i].sockaddr->sa_family == AF_INET6 && ls[i].ipv6only) { -
src/core/ngx_connection.h
old new struct ngx_listening_s { 62 62 unsigned nonblocking:1; 63 63 unsigned shared:1; /* shared between threads or processes */ 64 64 unsigned addr_ntop:1; 65 #if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT) 66 unsigned transparent:1; 67 #endif 65 68 66 69 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) 67 70 unsigned ipv6only:2; -
src/http/ngx_http.c
old new ngx_http_add_listening(ngx_conf_t *cf, n 1769 1769 ls->sndbuf = addr->opt.sndbuf; 1770 1770 1771 1771 ls->keepalive = addr->opt.so_keepalive; 1772 1773 #if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT) 1774 ls->transparent = addr->opt.transparent; 1775 #endif 1776 1772 1777 #if (NGX_HAVE_KEEPALIVE_TUNABLE) 1773 1778 ls->keepidle = addr->opt.tcp_keepidle; 1774 1779 ls->keepintvl = addr->opt.tcp_keepintvl; -
src/http/ngx_http_core_module.c
old new ngx_http_core_listen(ngx_conf_t *cf, ngx 3975 3975 continue; 3976 3976 } 3977 3977 3978 if (ngx_strcmp(value[n].data, "transparent") == 0) { 3979 #if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT) 3980 lsopt.transparent = 1; 3981 #else 3982 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 3983 "transparent mode is not supported " 3984 "on this platform, ignored", 3985 &value[n]); 3986 #endif 3987 continue; 3988 } 3989 3978 3990 if (ngx_strncmp(value[n].data, "ipv6only=o", 10) == 0) { 3979 3991 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) 3980 3992 struct sockaddr *sa; -
src/http/ngx_http_core_module.h
old new typedef struct { 72 72 unsigned default_server:1; 73 73 unsigned bind:1; 74 74 unsigned wildcard:1; 75 #if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT) 76 unsigned transparent:1; 77 #endif 75 78 #if (NGX_HTTP_SSL) 76 79 unsigned ssl:1; 77 80 #endif -
nginx-1.2.6
old new if [ $ngx_found != yes ]; then 298 298 fi 299 299 300 300 301 ngx_feature="IP_TRANSPARENT" 302 ngx_feature_name="NGX_HAVE_TRANSPARENT" 303 ngx_feature_run=no 304 ngx_feature_incs="#include <sys/socket.h> 305 #include <netinet/in.h>" 306 ngx_feature_path= 307 ngx_feature_libs= 308 ngx_feature_test="setsockopt(0, SOL_IP, IP_TRANSPARENT, NULL, 0)" 309 . auto/feature 310 311 301 312 ngx_feature="SO_SETFIB" 302 313 ngx_feature_name="NGX_HAVE_SETFIB" 303 314 ngx_feature_run=no
