aboutsummaryrefslogtreecommitdiffstats
path: root/packet-tcp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-04-11 08:59:43 +0000
committerGuy Harris <guy@alum.mit.edu>2002-04-11 08:59:43 +0000
commit08cf4d245f23bfa2199042475664d59fe360f433 (patch)
tree032060adff8022d10ee98eaf5847511107ab8ae0 /packet-tcp.c
parent5c75eb2df7319c5416f2a9da6b7254831dc3b4f8 (diff)
Do the "follow TCP stream" stuff before calling the subdissector, so
that it gets done even if the subdissector throws an exception (and so that, if the subdissector modifies the addresses or ports, we still hand the right values to "reassemble_tcp()"). svn path=/trunk/; revision=5140
Diffstat (limited to 'packet-tcp.c')
-rw-r--r--packet-tcp.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/packet-tcp.c b/packet-tcp.c
index ae868fec16..abd8e9a3f0 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.136 2002/03/31 22:43:03 guy Exp $
+ * $Id: packet-tcp.c,v 1.137 2002/04/11 08:59:43 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1187,6 +1187,19 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Check the packet length to see if there's more data
(it could be an ACK-only packet) */
length_remaining = tvb_length_remaining(tvb, offset);
+
+ if( data_out_file ) {
+ reassemble_tcp( th_seq, /* sequence number */
+ seglen, /* data length */
+ tvb_get_ptr(tvb, offset, length_remaining), /* data */
+ length_remaining, /* captured data length */
+ ( th_flags & TH_SYN ), /* is syn set? */
+ &pinfo->net_src,
+ &pinfo->net_dst,
+ pinfo->srcport,
+ pinfo->destport);
+ }
+
if (length_remaining != 0) {
if (th_flags & TH_RST) {
/*
@@ -1223,18 +1236,6 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
}
-
- if( data_out_file ) {
- reassemble_tcp( th_seq, /* sequence number */
- seglen, /* data length */
- tvb_get_ptr(tvb, offset, length_remaining), /* data */
- length_remaining, /* captured data length */
- ( th_flags & TH_SYN ), /* is syn set? */
- &pinfo->net_src,
- &pinfo->net_dst,
- pinfo->srcport,
- pinfo->destport);
- }
}
void