diff options
| author | Ruslan Ermilov <ru@FreeBSD.org> | 1999-09-12 16:07:24 +0000 |
|---|---|---|
| committer | Ruslan Ermilov <ru@FreeBSD.org> | 1999-09-12 16:07:24 +0000 |
| commit | b4f4b37f74bd9ad3076055e2e710ba9bec99760b (patch) | |
| tree | bd1ad7e01bd0952c09fc0fca3f96cccdc32c9a3e /lib | |
| parent | 5c5428d5fbe1827be8c874a7dd5348d2c4b6f58d (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libalias/alias.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/libalias/alias.c b/lib/libalias/alias.c index 8b18a73af140..982365681b3c 100644 --- a/lib/libalias/alias.c +++ b/lib/libalias/alias.c @@ -78,6 +78,7 @@ See HISTORY file for additional revisions. + $FreeBSD$ */ #include <stdio.h> @@ -115,7 +116,7 @@ TcpMonitorIn() -- These routines monitor TCP connections, and TcpMonitorOut() delete a link when a connection is closed. -These routines look for SYN, ACK and RST flags to determine when TCP +These routines look for SYN, FIN and RST flags to determine when TCP connections open and close. When a TCP connection closes, the data structure containing packet aliasing information is deleted after a timeout period. @@ -137,12 +138,13 @@ TcpMonitorIn(struct ip *pip, struct alias_link *link) switch (GetStateIn(link)) { case ALIAS_TCP_STATE_NOT_CONNECTED: - if (tc->th_flags & TH_SYN) + if (tc->th_flags & TH_RST) + SetStateIn(link, ALIAS_TCP_STATE_DISCONNECTED); + else if (tc->th_flags & TH_SYN) SetStateIn(link, ALIAS_TCP_STATE_CONNECTED); break; case ALIAS_TCP_STATE_CONNECTED: - if (tc->th_flags & TH_FIN - || tc->th_flags & TH_RST) + if (tc->th_flags & (TH_FIN | TH_RST)) SetStateIn(link, ALIAS_TCP_STATE_DISCONNECTED); break; } @@ -158,12 +160,13 @@ TcpMonitorOut(struct ip *pip, struct alias_link *link) switch (GetStateOut(link)) { case ALIAS_TCP_STATE_NOT_CONNECTED: - if (tc->th_flags & TH_SYN) + if (tc->th_flags & TH_RST) + SetStateOut(link, ALIAS_TCP_STATE_DISCONNECTED); + else if (tc->th_flags & TH_SYN) SetStateOut(link, ALIAS_TCP_STATE_CONNECTED); break; case ALIAS_TCP_STATE_CONNECTED: - if (tc->th_flags & TH_FIN - || tc->th_flags & TH_RST) + if (tc->th_flags & (TH_FIN | TH_RST)) SetStateOut(link, ALIAS_TCP_STATE_DISCONNECTED); break; } |
