aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2011-01-06 22:52:40 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2011-01-06 22:52:40 +0000
commitc903660d58344b187239395f3ef342cefd1e6550 (patch)
treeb403c99af4f81399df4c472650dc2cb459ffc7d2
parent9800b109b7859a09994125cdc04251d9203c581c (diff)
Don't use g_warning() - either you have a dissector bug, and should use
one of the macros to report that, or you have a problem with the packet, in which case you should note that in the protocol tree, or you have something you don't understand, in which case you should dissect whatever of it you do understand and put something appropriate, if possible, into the protocol tree for the rest. (And, if the length isn't right, there's not much you can do about it - you have to trust the length, and manage to fail somewhere else.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35408 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--epan/dissectors/packet-icmp.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c
index d2b6d0c1b7..cca525b987 100644
--- a/epan/dissectors/packet-icmp.c
+++ b/epan/dissectors/packet-icmp.c
@@ -387,9 +387,20 @@ dissect_mip_extensions(tvbuff_t *tvb, int offset, proto_tree *tree)
break;
default:
- g_warning("Unknown type(%u)! I hope the length is right (%u)",
- type, length);
- offset += length + 2;
+ /* type */
+ proto_tree_add_item(mip_tree, hf_icmp_mip_type, tvb, offset,
+ 1, FALSE);
+ offset++;
+ /* length */
+ proto_tree_add_item(mip_tree, hf_icmp_mip_length, tvb, offset,
+ 1, FALSE);
+ offset++;
+ /* data, if any */
+ if (length != 0) {
+ proto_tree_add_text(mip_tree, tvb, offset, length, "Contents");
+ offset+=length;
+ }
+
break;
} /* switch type */
} /* end while */