aboutsummaryrefslogtreecommitdiffstats
path: root/reassemble.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-03-04 06:47:10 +0000
committerGuy Harris <guy@alum.mit.edu>2003-03-04 06:47:10 +0000
commit9db95664d104089e059e1110bd4936cb8375ff26 (patch)
treead09573b7494a677e409713fff80f9bed96d8553 /reassemble.c
parent9a57223addead8c42ff2c9b98c88aa68d5f670fe (diff)
When deciding whether we have enough data in a lower-level packet to
attempt reassembly of a higher-level packet that includes the lower-level packet, use "tvb_bytes_exist()" to check whether all the data that's to be included in the reassembly is available, rather than by checking whether the packet is short. Add some checks of that sort that were missing. Use the reported length of the packet when doing reassembly. Make the "iphdrlen" field of a "packet_info" structure be the length of the IP header in bytes, not in 4-byte words. svn path=/trunk/; revision=7274
Diffstat (limited to 'reassemble.c')
-rw-r--r--reassemble.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/reassemble.c b/reassemble.c
index c71a0fb421..5d6a4544ed 100644
--- a/reassemble.c
+++ b/reassemble.c
@@ -1,7 +1,7 @@
/* reassemble.c
* Routines for {fragment,segment} reassembly
*
- * $Id: reassemble.c,v 1.28 2002/12/19 11:22:38 sahlberg Exp $
+ * $Id: reassemble.c,v 1.29 2003/03/04 06:47:10 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1084,8 +1084,8 @@ fragment_add_seq_check_work(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
/*
- * If this is a short frame, then we can't, and don't, do
- * reassembly on it.
+ * If we don't have all the data that is in this fragment,
+ * then we can't, and don't, do reassembly on it.
*
* If it's the first frame, handle it as an unfragmented packet.
* Otherwise, just handle it as a fragment.
@@ -1093,7 +1093,7 @@ fragment_add_seq_check_work(tvbuff_t *tvb, int offset, packet_info *pinfo,
* If "more_frags" isn't set, we get rid of the entry in the
* hash table for this reassembly, as we don't need it any more.
*/
- if (tvb_reported_length(tvb) > tvb_length(tvb)) {
+ if (!tvb_bytes_exist(tvb, offset, frag_data_len)) {
if (!more_frags) {
/*
* Remove this from the table of in-progress