diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2002-09-11 09:08:07 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2002-09-11 09:08:07 +0000 |
commit | b8769cdfa9816f039d07b39b5d402398698b7f2f (patch) | |
tree | 9f7ef5760338f48fbe3542e2d63df823eb7c5ea0 /packet-tcp.c | |
parent | 14243464b9236acd4c6d5b3143574c573f8396a5 (diff) |
Tiny change to the tcp seq/ack analysis.
If the addresses are equal, compare the ports with '>' instead of '-'
since '>' will work regardless of whether the values are unsigned or not.
svn path=/trunk/; revision=6268
Diffstat (limited to 'packet-tcp.c')
-rw-r--r-- | packet-tcp.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/packet-tcp.c b/packet-tcp.c index 310f356008..621cc7a135 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.157 2002/08/28 21:00:35 jmayer Exp $ + * $Id: packet-tcp.c,v 1.158 2002/09/11 09:08:07 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -246,18 +246,11 @@ tcp_analyze_sequence_number(packet_info *pinfo, guint32 seq, guint32 ack, guint3 /* check direction and get ua lists */ direction=CMP_ADDRESS(&pinfo->src, &pinfo->dst); - if(direction==0) - direction=pinfo->srcport - pinfo->destport; + /* if the addresses are equal, match the ports instead */ + if(direction==0) { + direction= (pinfo->srcport > pinfo->destport); + } if(direction>=0){ - /* - * XXX - if direction == 0, that'll be true for packets - * from both sides of the connection, so this won't - * work. - * - * That'd be a connection from a given port on a machine - * to that same port on the same machine; does that ever - * happen? - */ ual1=tcpd->ual1; ual2=tcpd->ual2; base_seq=tcpd->base_seq1; |