Fixed bug not handling FIN pakcets properly.
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 16 Aug 2002 20:59:18 +0000 (20:59 +0000)
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 16 Aug 2002 20:59:18 +0000 (20:59 +0000)
Fixed another tiny bug where it would forget to check ACKs outside the window
sometimes.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6001 f5534014-38df-0310-8fa8-9805f1628bb7

packet-tcp.c

index 23f2f2dd334b0c9151414ab7633c49b4df984ac4..1d361fd1739477ad381605ff607275ed2956a49e 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-tcp.c
  * Routines for TCP packet disassembly
  *
- * $Id: packet-tcp.c,v 1.150 2002/08/03 23:20:06 jmayer Exp $
+ * $Id: packet-tcp.c,v 1.151 2002/08/16 20:59:18 sahlberg Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -289,6 +289,13 @@ 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)) {
                struct tcp_acked *ta;
@@ -460,7 +467,7 @@ ack_finished:
        if( (!ual2) && (flags&TH_ACK) ){
                ual2=g_mem_chunk_alloc(tcp_unacked_chunk);
                ual2->next=NULL;
-               ual2->frame=0;
+               ual2->frame=pinfo->fd->num;
                ual2->seq=ack;
                ual2->nextseq=ack;
                ual2->ts.secs=0;