summaryrefslogtreecommitdiffhomepage
path: root/src/http
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-07-05 13:49:16 +0000
committerIgor Sysoev <igor@sysoev.ru>2010-07-05 13:49:16 +0000
commit0bd7a7d8941087929b270f7862f1bbacc69282c1 (patch)
tree42c25fc6de1079f8b91b0cd16160b288c44d3705 /src/http
parent1a5d7553da68081ffa3e0a5b89ee844fbd8a7f14 (diff)
downloadnginx-0bd7a7d8941087929b270f7862f1bbacc69282c1.tar.gz
nginx-0bd7a7d8941087929b270f7862f1bbacc69282c1.tar.bz2
listen setfib=X
Diffstat (limited to '')
-rw-r--r--src/http/ngx_http.c4
-rw-r--r--src/http/ngx_http_core_module.c19
-rw-r--r--src/http/ngx_http_core_module.h3
3 files changed, 26 insertions, 0 deletions
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index 84867887d..9f9294ce5 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -1720,6 +1720,10 @@ ngx_http_add_listening(ngx_conf_t *cf, ngx_http_conf_addr_t *addr)
ls->ipv6only = addr->opt.ipv6only;
#endif
+#if (NGX_HAVE_SETFIB)
+ ls->setfib = addr->opt.setfib;
+#endif
+
return ls;
}
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 1654510be..0296d00bf 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -2992,6 +2992,9 @@ ngx_http_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
lsopt.backlog = NGX_LISTEN_BACKLOG;
lsopt.rcvbuf = -1;
lsopt.sndbuf = -1;
+#if (NGX_HAVE_SETFIB)
+ lsopt.setfib = -1;
+#endif
lsopt.wildcard = 1;
(void) ngx_sock_ntop(&lsopt.u.sockaddr, lsopt.addr,
@@ -3410,6 +3413,9 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
lsopt.backlog = NGX_LISTEN_BACKLOG;
lsopt.rcvbuf = -1;
lsopt.sndbuf = -1;
+#if (NGX_HAVE_SETFIB)
+ lsopt.setfib = -1;
+#endif
lsopt.wildcard = u.wildcard;
(void) ngx_sock_ntop(&lsopt.u.sockaddr, lsopt.addr,
@@ -3430,6 +3436,19 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
continue;
}
+#if (NGX_HAVE_SETFIB)
+ if (ngx_strncmp(value[n].data, "setfib=", 7) == 0) {
+ lsopt.setfib = ngx_atoi(value[n].data + 7, value[n].len - 7);
+
+ if (lsopt.setfib == NGX_ERROR || lsopt.setfib == 0) {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "invalid setfib \"%V\"", &value[n]);
+ return NGX_CONF_ERROR;
+ }
+
+ continue;
+ }
+#endif
if (ngx_strncmp(value[n].data, "backlog=", 8) == 0) {
lsopt.backlog = ngx_atoi(value[n].data + 8, value[n].len - 8);
lsopt.set = 1;
diff --git a/src/http/ngx_http_core_module.h b/src/http/ngx_http_core_module.h
index 2f49202c3..82c120845 100644
--- a/src/http/ngx_http_core_module.h
+++ b/src/http/ngx_http_core_module.h
@@ -71,6 +71,9 @@ typedef struct {
int backlog;
int rcvbuf;
int sndbuf;
+#if (NGX_HAVE_SETFIB)
+ int setfib;
+#endif
#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
char *accept_filter;