summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_timewait.c
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2005-10-02 08:43:57 +0000
committermaxim <maxim@FreeBSD.org>2005-10-02 08:43:57 +0000
commit4a3de87cfe892ce5e9e4b40be039f2547a891155 (patch)
treef00e771ac2f9f4c720589f1d6b9473359c02c746 /sys/netinet/tcp_timewait.c
parentfe2cef7133bb9cdb247a331cc9bcc62437221eb7 (diff)
downloadFreeBSD-src-4a3de87cfe892ce5e9e4b40be039f2547a891155.zip
FreeBSD-src-4a3de87cfe892ce5e9e4b40be039f2547a891155.tar.gz
o Teach sysctl_drop() how to deal with the sockets in TIME_WAIT state.
This is a special case because tcp_twstart() destroys a tcp control block via tcp_discardcb() so we cannot call tcp_drop(struct *tcpcb) on such connections. Use tcp_twclose() instead. MFC after: 5 days
Diffstat (limited to 'sys/netinet/tcp_timewait.c')
-rw-r--r--sys/netinet/tcp_timewait.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index f8b0707..6a3068a 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -2150,6 +2150,7 @@ sysctl_drop(SYSCTL_HANDLER_ARGS)
struct sockaddr_storage addrs[2];
struct inpcb *inp;
struct tcpcb *tp;
+ struct tcptw *tw;
struct sockaddr_in *fin, *lin;
#ifdef INET6
struct sockaddr_in6 *fin6, *lin6;
@@ -2224,7 +2225,10 @@ sysctl_drop(SYSCTL_HANDLER_ARGS)
}
if (inp != NULL) {
INP_LOCK(inp);
- if ((tp = intotcpcb(inp)) &&
+ if ((tw = intotw(inp)) &&
+ (inp->inp_vflag & INP_TIMEWAIT) != 0) {
+ (void) tcp_twclose(tw, 0);
+ } else if ((tp = intotcpcb(inp)) &&
((inp->inp_socket->so_options & SO_ACCEPTCONN) == 0)) {
tp = tcp_drop(tp, ECONNABORTED);
if (tp != NULL)
OpenPOWER on IntegriCloud