aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2025-12-12 17:22:56 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2025-12-12 17:22:56 +0000
commit929338d1e92ada4ff4ee2061c625fa45a1a34caf (patch)
treea952829363d902d9c792a1803926960fcd831dee
parentef2d586d7efb908bf39e7d5eb5d4305193d0ca6e (diff)
tpc: retire net.inet.tcp.nolocaltimewait
See c3fc0db3bc50df18a724e6e6b12ea4e060fd9255 for details.
-rw-r--r--sys/netinet/tcp_timewait.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index 3afa3c0ac1c1..259ec7dc50dc 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -86,30 +86,6 @@
#include <security/mac/mac_framework.h>
-VNET_DEFINE_STATIC(bool, nolocaltimewait) = false;
-#define V_nolocaltimewait VNET(nolocaltimewait)
-
-static int
-sysctl_net_inet_tcp_nolocaltimewait(SYSCTL_HANDLER_ARGS)
-{
- int error;
- bool new;
-
- new = V_nolocaltimewait;
- error = sysctl_handle_bool(oidp, &new, 0, req);
- if (error == 0 && req->newptr) {
- V_nolocaltimewait = new;
- gone_in(16, "net.inet.tcp.nolocaltimewait is obsolete."
- " Use net.inet.tcp.msl_local instead.\n");
- }
- return (error);
-}
-
-SYSCTL_PROC(_net_inet_tcp, OID_AUTO, nolocaltimewait,
- CTLFLAG_VNET | CTLFLAG_RW | CTLTYPE_U8,
- &VNET_NAME(nolocaltimewait), 0, sysctl_net_inet_tcp_nolocaltimewait, "CU",
- "Do not create TCP TIME_WAIT state for local connections");
-
static u_int
tcp_eff_msl(struct tcpcb *tp)
{
@@ -146,9 +122,6 @@ void
tcp_twstart(struct tcpcb *tp)
{
struct inpcb *inp = tptoinpcb(tp);
-#ifdef INET6
- bool isipv6 = inp->inp_inc.inc_flags & INC_ISIPV6;
-#endif
NET_EPOCH_ASSERT();
INP_WLOCK_ASSERT(inp);
@@ -164,21 +137,6 @@ tcp_twstart(struct tcpcb *tp)
if (tp->t_flags & TF_ACKNOW)
(void) tcp_output(tp);
- if (V_nolocaltimewait && (
-#ifdef INET6
- isipv6 ? in6_localip(&inp->in6p_faddr) :
-#endif
-#ifdef INET
- in_localip(inp->inp_faddr)
-#else
- false
-#endif
- )) {
- if ((tp = tcp_close(tp)) != NULL)
- INP_WUNLOCK(inp);
- return;
- }
-
tcp_timer_activate(tp, TT_2MSL, 2 * tcp_eff_msl(tp));
INP_WUNLOCK(inp);
}