svn commit: r312907 - head/sys/netinet
Hiren Panchasara
hiren at FreeBSD.org
Fri Jan 27 23:10:47 UTC 2017
Author: hiren
Date: Fri Jan 27 23:10:46 2017
New Revision: 312907
URL: https://svnweb.freebsd.org/changeset/base/312907
Log:
Add a knob to change default behavior of inheriting listen socket's tcp stack
regardless of what the default stack for the system is set to.
With current/default behavior, after changing the default tcp stack, the
application needs to be restarted to pick up that change. Setting this new knob
net.inet.tcp.functions_inherit_listen_socket_stack to '0' would change that
behavior and make any new connection use the newly selected default tcp stack.
Reviewed by: rrs
MFC after: 2 weeks
Sponsored by: Limelight Networks
Modified:
head/sys/netinet/tcp_syncache.c
Modified: head/sys/netinet/tcp_syncache.c
==============================================================================
--- head/sys/netinet/tcp_syncache.c Fri Jan 27 23:08:30 2017 (r312906)
+++ head/sys/netinet/tcp_syncache.c Fri Jan 27 23:10:46 2017 (r312907)
@@ -120,6 +120,14 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, sync
&VNET_NAME(tcp_syncookiesonly), 0,
"Use only TCP SYN cookies");
+static VNET_DEFINE(int, functions_inherit_listen_socket_stack) = 1;
+#define V_functions_inherit_listen_socket_stack \
+ VNET(functions_inherit_listen_socket_stack)
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, functions_inherit_listen_socket_stack,
+ CTLFLAG_VNET | CTLFLAG_RW,
+ &VNET_NAME(functions_inherit_listen_socket_stack), 0,
+ "Inherit listen socket's stack");
+
#ifdef TCP_OFFLOAD
#define ADDED_BY_TOE(sc) ((sc)->sc_tod != NULL)
#endif
@@ -830,7 +838,7 @@ syncache_socket(struct syncache *sc, str
tcp_rcvseqinit(tp);
tcp_sendseqinit(tp);
blk = sototcpcb(lso)->t_fb;
- if (blk != tp->t_fb) {
+ if (V_functions_inherit_listen_socket_stack && blk != tp->t_fb) {
/*
* Our parents t_fb was not the default,
* we need to release our ref on tp->t_fb and
More information about the svn-src-all
mailing list