diff options
author | jayanth <jayanth@FreeBSD.org> | 2000-07-21 23:26:37 +0000 |
---|---|---|
committer | jayanth <jayanth@FreeBSD.org> | 2000-07-21 23:26:37 +0000 |
commit | 8c2fae53742ffaf1871be8c56947b9ac306af564 (patch) | |
tree | 2f611787ca557e2258deb0760e8546f691acd9c6 /sys/netinet/tcp_input.c | |
parent | 9ed7fa2a25f71339ba2c167377581dec855bbbe4 (diff) | |
download | FreeBSD-src-8c2fae53742ffaf1871be8c56947b9ac306af564.zip FreeBSD-src-8c2fae53742ffaf1871be8c56947b9ac306af564.tar.gz |
When a connection is being dropped due to a listen queue overflow,
delete the cloned route that is associated with the connection.
This does not exhaust the routing table memory when the system
is under a SYN flood attack. The route entry is not deleted if there
is any prior information cached in it.
Reviewed by: Peter Wemm,asmodai
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 427e6c7..f49a7f4 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -121,6 +121,11 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, delayed_ack, CTLFLAG_RW, &tcp_delack_enabled, 0, "Delay ACK to try and piggyback it onto a data packet"); +int tcp_lq_overflow = 1; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_lq_overflow, CTLFLAG_RW, + &tcp_lq_overflow, 0, + "Listen Queue Overflow"); + #ifdef TCP_DROP_SYNFIN static int drop_synfin = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, drop_synfin, CTLFLAG_RW, @@ -710,6 +715,9 @@ findpcb: tcpstat.tcps_listendrop++; so2 = sodropablereq(so); if (so2) { + if (tcp_lq_overflow) + sototcpcb(so2)->t_flags |= + TF_LQ_OVERFLOW; tcp_drop(sototcpcb(so2), ETIMEDOUT); so2 = sonewconn(so, 0); } |