aboutsummaryrefslogtreecommitdiffstats
path: root/packet-tcp.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-11-19 09:32:04 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-11-19 09:32:04 +0000
commita07a627e3f5f632d93ff4bb41fb99e4b9953354d (patch)
treefbc081be1d44efe7f35c34e8163987a675a1ac44 /packet-tcp.c
parent2b01591a523582aa791cf49744287a947acadd7f (diff)
Update to TCP, when we see a SYN|ACK packetm reset base_ack to the current ACK-1 so that it looks right when doing relative sequence numbers.
I.e. SEQ : seq==0 ack==0 SEQ|ACK seq==0 ack==1 ACK seq==1 ack==1 This looks much more correct. This change also fixes the problem reported to ethereal-dev recently with "Follow TCP Stream" dropping the first character of the stream. svn path=/trunk/; revision=9034
Diffstat (limited to 'packet-tcp.c')
-rw-r--r--packet-tcp.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/packet-tcp.c b/packet-tcp.c
index d52ef32ddb..bd555f15ed 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.218 2003/11/18 19:46:41 guy Exp $
+ * $Id: packet-tcp.c,v 1.219 2003/11/19 09:32:04 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -597,7 +597,7 @@ tcp_analyze_sequence_number(packet_info *pinfo, guint32 seq, guint32 ack, guint3
{
struct tcp_unacked *u=NULL;
printf("\n");
-printf("analyze_sequence_number(frame:%d seq:%d nextseq:%d ack:%d)\n",pinfo->fd->num,seq,seq+seglen,ack);
+printf("analyze_sequence_number(frame:%d seq:%d nextseq:%d ack:%d baseseq:0x%08x baseack:0x%08x)\n",pinfo->fd->num,seq,seq+seglen,ack,base_seq,base_ack);
printf("UAL1:\n");
for(u=ual1;u;u=u->next){
printf(" Frame:%d seq:%d nseq:%d time:%d.%09d ack:%d:%d\n",u->frame,u->seq,u->nextseq,u->ts.secs,u->ts.nsecs,ack1,ack2);
@@ -633,7 +633,7 @@ printf(" Frame:%d seq:%d nseq:%d time:%d.%09d ack:%d:%d\n",u->frame,u->seq,u->n
ack2=0;
num1_acks=0;
num2_acks=0;
- ual1->seq=seq+1;
+ ual1->seq=seq;
ual1->nextseq=seq+1;
ual1->ts.secs=pinfo->fd->abs_secs;
ual1->ts.nsecs=pinfo->fd->abs_usecs*1000;
@@ -641,7 +641,14 @@ printf(" Frame:%d seq:%d nseq:%d time:%d.%09d ack:%d:%d\n",u->frame,u->seq,u->n
ual1->flags=0;
if(tcp_relative_seq){
base_seq=seq;
- base_ack=ack;
+ /* if this was an SYN|ACK packet then set base_ack
+ * reflect the start of the sequence, i.e. one less
+ */
+ if(flags&TH_ACK){
+ base_ack=ack-1;
+ } else {
+ base_ack=ack;
+ }
}
goto seq_finished;
}