diff options
author | mohans <mohans@FreeBSD.org> | 2006-08-11 21:15:23 +0000 |
---|---|---|
committer | mohans <mohans@FreeBSD.org> | 2006-08-11 21:15:23 +0000 |
commit | 707c86ce464655cc21368747d6d2380c3a45d907 (patch) | |
tree | 79bc8d154909be166e8a4c6f574e46e753772107 /sys/netinet/tcp_timer.c | |
parent | ce9f8963fd6c7fcb782d8b9eebf51fb108d847f8 (diff) | |
download | FreeBSD-src-707c86ce464655cc21368747d6d2380c3a45d907.zip FreeBSD-src-707c86ce464655cc21368747d6d2380c3a45d907.tar.gz |
Fixes an edge case bug in timewait handling where ticks rolling over causing
the timewait expiry to be exactly 0 corrupts the timewait queues (and that entry).
Reviewed by: silby
Diffstat (limited to 'sys/netinet/tcp_timer.c')
-rw-r--r-- | sys/netinet/tcp_timer.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 6b8698c..5c105b4 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -257,14 +257,14 @@ tcp_timer_init(void) } void -tcp_timer_2msl_reset(struct tcptw *tw, int timeo) +tcp_timer_2msl_reset(struct tcptw *tw, int timeo, int rearm) { int i; struct tcptw *tw_tail; INP_INFO_WLOCK_ASSERT(&tcbinfo); INP_LOCK_ASSERT(tw->tw_inpcb); - if (tw->tw_time != 0) + if (rearm) LIST_REMOVE(tw, tw_2msl); tw->tw_time = timeo + ticks; i = timeo > tcp_msl ? 1 : 0; @@ -277,8 +277,7 @@ tcp_timer_2msl_stop(struct tcptw *tw) { INP_INFO_WLOCK_ASSERT(&tcbinfo); - if (tw->tw_time != 0) - LIST_REMOVE(tw, tw_2msl); + LIST_REMOVE(tw, tw_2msl); } struct tcptw * |