summaryrefslogtreecommitdiff
path: root/epan/show_exception.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-04-18 19:22:24 +0000
committerGuy Harris <guy@alum.mit.edu>2013-04-18 19:22:24 +0000
commitc0c15029ed8d1234c95a71fdf7510a8bf0964fcb (patch)
tree585d3be4be77a93eb5fed23814d87ced468e9df9 /epan/show_exception.c
parentd89d6c8314b8a5c407f86fe0f6e029b4da582b43 (diff)
downloadwireshark-c0c15029ed8d1234c95a71fdf7510a8bf0964fcb.tar.gz
Add to tvbuffs a "fragment length" field; if the tvbuff represents the
first fragment of a non-reassembled packet, and we know the length the packet would have if it were reassembled, this field holds the length of the fragment, and the "reported length" field shows the length the packet would have if it were reassembled, so going past the end of the fragment but staying within the length of the reassembled packet can be reported as "dissection would have worked if the packet had been reassembled" rather than "the packet is too short, so it was probably malformed". Add a FragmentBoundsError exception, thrown in the "dissection would have worked if the packet had been reassembled" case. Add a new tvb_new_subset_length_fragment() routine to create a new subset tvb with specified fragment and reported lengths. Use it in the CLNP dissector. Add some more sanity checks in the CLNP dissector. svn path=/trunk/; revision=48917
Diffstat (limited to 'epan/show_exception.c')
-rw-r--r--epan/show_exception.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/epan/show_exception.c b/epan/show_exception.c
index ddc41bff85..641b86f786 100644
--- a/epan/show_exception.c
+++ b/epan/show_exception.c
@@ -84,6 +84,17 @@ show_exception(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR, "Packet size limited");*/
break;
+ case FragmentBoundsError:
+ col_append_fstr(pinfo->cinfo, COL_INFO, "[Unreassembled Packet%s]", pinfo->noreassembly_reason);
+ /*item =*/ proto_tree_add_protocol_format(tree, proto_unreassembled,
+ tvb, 0, 0, "[Unreassembled Packet%s: %s]",
+ pinfo->noreassembly_reason, pinfo->current_proto);
+ /* Don't record FragmentBoundsError exceptions as expert events - they merely
+ * reflect dissection done with reassembly turned off
+ * (any case where it's caused by something else is a bug). */
+ /* expert_add_info_format(pinfo, item, PI_REASSEMBLE, PI_WARN, "Unreassembled Packet (Exception occured)");*/
+ break;
+
case ReportedBoundsError:
show_reported_bounds_error(tvb, pinfo, tree);
break;