summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-icmp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-01-06 22:52:40 +0000
committerGuy Harris <guy@alum.mit.edu>2011-01-06 22:52:40 +0000
commitb711e23baa2b66455f5bead7b4358b9b74f9ffcc (patch)
treeb403c99af4f81399df4c472650dc2cb459ffc7d2 /epan/dissectors/packet-icmp.c
parent802308ca01a3122275916ef31c64bc8e0e14b819 (diff)
downloadwireshark-b711e23baa2b66455f5bead7b4358b9b74f9ffcc.tar.gz
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
Diffstat (limited to 'epan/dissectors/packet-icmp.c')
-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 */