diff options
author | jlemon <jlemon@FreeBSD.org> | 2003-02-19 22:32:43 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2003-02-19 22:32:43 +0000 |
commit | a8bc02dcb257f24a8246bb1c31abe58bf12ebd04 (patch) | |
tree | 6317b858b0555a797efb2e5b5bd4c2eebbdc0d10 /sys/netinet/tcp_timer.c | |
parent | 79a1ebfa6f53d733dc4775c2031ff3d16e53b75c (diff) | |
download | FreeBSD-src-a8bc02dcb257f24a8246bb1c31abe58bf12ebd04.zip FreeBSD-src-a8bc02dcb257f24a8246bb1c31abe58bf12ebd04.tar.gz |
Add a TCP TIMEWAIT state which uses less space than a fullblown TCP
control block. Allow the socket and tcpcb structures to be freed
earlier than inpcb. Update code to understand an inp w/o a socket.
Reviewed by: hsu, silby, jayanth
Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'sys/netinet/tcp_timer.c')
-rw-r--r-- | sys/netinet/tcp_timer.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 8a68579..16955d6 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -252,6 +252,33 @@ tcp_timer_2msl(xtp) } void +tcp_timer_2msl_tw(xtw) + void *xtw; +{ + struct tcptw *tw = xtw; + int s; + + s = splnet(); + INP_INFO_WLOCK(&tcbinfo); + if (tw->tw_inpcb == NULL) { + INP_INFO_WUNLOCK(&tcbinfo); + splx(s); + return; + } + INP_LOCK(tw->tw_inpcb); + if (callout_pending(tw->tt_2msl) || !callout_active(tw->tt_2msl)) { + INP_UNLOCK(tw->tw_inpcb); + INP_INFO_WUNLOCK(&tcbinfo); + splx(s); + return; + } + callout_deactivate(tw->tt_2msl); + tcp_twclose(tw); + INP_INFO_WUNLOCK(&tcbinfo); + splx(s); +} + +void tcp_timer_keep(xtp) void *xtp; { |