diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-01-20 01:04:18 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-01-20 01:04:18 +0000 |
commit | ce6db7ff97ab31cbb38fd09c0a9f52e47d9c9443 (patch) | |
tree | 6c84a286bfc6e7d5aecc1a10d6a66939b5123830 /packet-ipv6.c | |
parent | b6c6ff41067fb5f54c46c28ea1ba087fb05bb787 (diff) |
If reassembly is enabled, don't try to do any reassembly work at all on
a fragment unless we've captured all the data in the fragment and (in
IPv4 and CLNP) it has a valid checksum, so that if the first fragment is
a short frame or a frame with an invalid checksum, we'll treat it as if
reassembly weren't enabled, and will dissect what data we have in it,
rather than not dissecting *any* of the fragments above the IP/CLNP
layer.
svn path=/trunk/; revision=4575
Diffstat (limited to 'packet-ipv6.c')
-rw-r--r-- | packet-ipv6.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/packet-ipv6.c b/packet-ipv6.c index 563f0d60be..b15cea288e 100644 --- a/packet-ipv6.c +++ b/packet-ipv6.c @@ -1,7 +1,7 @@ /* packet-ipv6.c * Routines for IPv6 packet disassembly * - * $Id: packet-ipv6.c,v 1.73 2002/01/17 06:29:16 guy Exp $ + * $Id: packet-ipv6.c,v 1.74 2002/01/20 01:04:18 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -807,22 +807,16 @@ again: proto_tree_add_uint_hidden(ipv6_tree, hf_ipv6_final, tvb, poffset, 1, nxt); #endif - /* If ipv6_reassemble is on and this is a fragment, then just add the fragment - * to the hashtable. + /* If ipv6_reassemble is on, this is a fragment, and we have all the data + * in the fragment, then just add the fragment to the hashtable. */ save_fragmented = pinfo->fragmented; - if (ipv6_reassemble && frag) { - /* We're reassembling, and this is part of a fragmented datagram. - Add the fragment to the hash table if the frame isn't truncated. */ - if (tvb_reported_length(tvb) <= tvb_length(tvb)) { - ipfd_head = fragment_add(tvb, offset, pinfo, ident, - ipv6_fragment_table, - offlg & IP6F_OFF_MASK, - plen, - offlg & IP6F_MORE_FRAG); - } else { - ipfd_head = NULL; - } + if (ipv6_reassemble && frag && tvb_reported_length(tvb) <= tvb_length(tvb)) { + ipfd_head = fragment_add(tvb, offset, pinfo, ident, + ipv6_fragment_table, + offlg & IP6F_OFF_MASK, + plen, + offlg & IP6F_MORE_FRAG); if (ipfd_head != NULL) { fragment_data *ipfd; |