From b711e23baa2b66455f5bead7b4358b9b74f9ffcc Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 6 Jan 2011 22:52:40 +0000 Subject: [PATCH] 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.) svn path=/trunk/; revision=35408 --- epan/dissectors/packet-icmp.c | 17 ++++++++++++++--- 1 file 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 */