aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-03-26 08:00:24 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-03-26 08:00:24 +0000
commit886cbe2321922d4e25eb1de5ecb620e6ef16b01c (patch)
treed944e4f019f679f4c43fc091d32fbcd7e4e5830b
parent9f3902270e55811d2d2ee16a0ecd1a4b499ceb55 (diff)
downloadwireshark-886cbe2321922d4e25eb1de5ecb620e6ef16b01c.tar.gz
wireshark-886cbe2321922d4e25eb1de5ecb620e6ef16b01c.tar.bz2
wireshark-886cbe2321922d4e25eb1de5ecb620e6ef16b01c.zip
Fixed a small bug in tcp sequence number analysis.
FIN flag would previously only add one to the sequence number if the FIN packet was empty, i.e. did not carry any payload data. This caused ethereal to incorrectly flag the ACK to such packets (FIN+payload data) to be incorrectly flagged as ACK to previously lost segment. Change the algorithm to always add 1 to the segment length, and thus the sequence number for all packets with teh FIN bit set. svn path=/trunk/; revision=7371
-rw-r--r--packet-tcp.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/packet-tcp.c b/packet-tcp.c
index 7ec1fdaf00..f25b981f97 100644
--- a/packet-tcp.c
+++ b/packet-tcp.c
@@ -1,7 +1,7 @@
/* packet-tcp.c
* Routines for TCP packet disassembly
*
- * $Id: packet-tcp.c,v 1.186 2003/03/05 07:17:50 guy Exp $
+ * $Id: packet-tcp.c,v 1.187 2003/03/26 08:00:24 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -317,6 +317,14 @@ tcp_analyze_sequence_number(packet_info *pinfo, guint32 seq, guint32 ack, guint3
base_ack=ack;
}
+
+ /* To handle FIN, just add 1 to the length.
+ else the ACK following the FIN-ACK will look like it was
+ outside the window. */
+ if( flags&TH_FIN ){
+ seglen+=1;
+ }
+
/* handle the sequence numbers */
/* if this was a SYN packet, then remove existing list and
* put SEQ+1 first the list */
@@ -360,12 +368,6 @@ tcp_analyze_sequence_number(packet_info *pinfo, guint32 seq, guint32 ack, guint3
/* if we get past here we know that ual1 points to a segment */
- /* To handle FIN, just pretend they have a length of 1.
- else the ACK following the FIN-ACK will look like it was
- outside the window. */
- if( (!seglen) && (flags&TH_FIN) ){
- seglen=1;
- }
/* if seq is beyond ual1->nextseq we have lost a segment */
if (GT_SEQ(seq, ual1->nextseq)) {