listen setfib=X
diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c
index 4a90b61..c495edd 100644
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -74,6 +74,10 @@
ls->rcvbuf = -1;
ls->sndbuf = -1;
+#if (NGX_HAVE_SETFIB)
+ ls->setfib = -1;
+#endif
+
return ls;
}
@@ -179,6 +183,25 @@
ls[i].sndbuf = -1;
}
+#if 0
+ /* SO_SETFIB is currently a set only option */
+
+#if (NGX_HAVE_SETFIB)
+
+ if (getsockopt(ls[i].setfib, SOL_SOCKET, SO_SETFIB,
+ (void *) &ls[i].setfib, &olen)
+ == -1)
+ {
+ ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno,
+ "getsockopt(SO_SETFIB) %V failed, ignored",
+ &ls[i].addr_text);
+
+ ls[i].setfib = -1;
+ }
+
+#endif
+#endif
+
#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
ngx_memzero(&af, sizeof(struct accept_filter_arg));
@@ -473,6 +496,19 @@
}
}
+#if (NGX_HAVE_SETFIB)
+ if (ls[i].setfib != -1) {
+ if (setsockopt(ls[i].fd, SOL_SOCKET, SO_SETFIB,
+ (const void *) &ls[i].setfib, sizeof(int))
+ == -1)
+ {
+ ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno,
+ "setsockopt(SO_SETFIB, %d) %V failed, ignored",
+ ls[i].setfib, &ls[i].addr_text);
+ }
+ }
+#endif
+
#if 0
if (1) {
int tcp_nodelay = 1;