aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Silbersack <silby@FreeBSD.org>2014-05-16 01:38:38 +0000
committerMike Silbersack <silby@FreeBSD.org>2014-05-16 01:38:38 +0000
commitf1395664e557a8a7c235648b9dff0b0be6d51ca2 (patch)
tree3a5e51d341d105e1183416079714382302eacd02 /sys
parent2a1681877eb9b720c5dfec192132960ab5acde8c (diff)
downloadsrc-f1395664e557a8a7c235648b9dff0b0be6d51ca2.tar.gz
src-f1395664e557a8a7c235648b9dff0b0be6d51ca2.zip
Remove the function tcp_twrecycleable; it has been #if 0'd for
eight years. The original concept was to improve the corner case where you run out of ephemeral ports, but it was causing performance problems and the mechanism of limiting the number of time_wait sockets serves the same purpose in the end. Reviewed by: bz
Notes
Notes: svn path=/head/; revision=266205
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/tcp_timewait.c33
-rw-r--r--sys/netinet/tcp_var.h3
2 files changed, 0 insertions, 36 deletions
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index 0ebb39e6992b..92cf17960983 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -357,39 +357,6 @@ tcp_twstart(struct tcpcb *tp)
INP_WUNLOCK(inp);
}
-#if 0
-/*
- * The appromixate rate of ISN increase of Microsoft TCP stacks;
- * the actual rate is slightly higher due to the addition of
- * random positive increments.
- *
- * Most other new OSes use semi-randomized ISN values, so we
- * do not need to worry about them.
- */
-#define MS_ISN_BYTES_PER_SECOND 250000
-
-/*
- * Determine if the ISN we will generate has advanced beyond the last
- * sequence number used by the previous connection. If so, indicate
- * that it is safe to recycle this tw socket by returning 1.
- */
-int
-tcp_twrecycleable(struct tcptw *tw)
-{
- tcp_seq new_iss = tw->iss;
- tcp_seq new_irs = tw->irs;
-
- INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
- new_iss += (ticks - tw->t_starttime) * (ISN_BYTES_PER_SECOND / hz);
- new_irs += (ticks - tw->t_starttime) * (MS_ISN_BYTES_PER_SECOND / hz);
-
- if (SEQ_GT(new_iss, tw->snd_nxt) && SEQ_GT(new_irs, tw->rcv_nxt))
- return (1);
- else
- return (0);
-}
-#endif
-
/*
* Returns 1 if the TIME_WAIT state was killed and we should start over,
* looking for a pcb in the listen state. Returns 0 otherwise.
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index 4d7074a4213c..de26cfbf3845 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -635,9 +635,6 @@ struct tcpcb *
tcp_close(struct tcpcb *);
void tcp_discardcb(struct tcpcb *);
void tcp_twstart(struct tcpcb *);
-#if 0
-int tcp_twrecycleable(struct tcptw *tw);
-#endif
void tcp_twclose(struct tcptw *_tw, int _reuse);
void tcp_ctlinput(int, struct sockaddr *, void *);
int tcp_ctloutput(struct socket *, struct sockopt *);