diff options
author | Michael Mann <mmann78@netscape.net> | 2016-07-21 10:21:25 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-07-27 03:40:02 +0000 |
commit | 8b0e9c66728f6a39bbe3ada1029e13ad1378013a (patch) | |
tree | c0c1b4da1845069520d4e131db96e6143e4ca772 /epan/dissectors/packet-dvmrp.c | |
parent | b7f1e99f7f4c75fa4bac1ccba77087fb0e50b8ac (diff) |
Follow up for proto_tree_add_checksum.
Fill in the "gaps" so that all dissectors that verify checksums have both a
status and expert info field.
Also address comments from original proto_tree_add_checksum patch that didn't make it.
Ping-Bug: 8859
Change-Id: I2e6640108fd6bb218cb959fe9e4ba98a13e43a2f
Reviewed-on: https://code.wireshark.org/review/16590
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-dvmrp.c')
-rw-r--r-- | epan/dissectors/packet-dvmrp.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/epan/dissectors/packet-dvmrp.c b/epan/dissectors/packet-dvmrp.c index fead40077f..54a85eb372 100644 --- a/epan/dissectors/packet-dvmrp.c +++ b/epan/dissectors/packet-dvmrp.c @@ -53,6 +53,7 @@ #include <epan/packet.h> #include <epan/prefs.h> +#include <epan/expert.h> #include "packet-igmp.h" void proto_register_dvmrp(void); @@ -109,6 +110,8 @@ static int ett_capabilities = -1; static int ett_flags = -1; static int ett_route = -1; +static expert_field ei_checksum = EI_INIT; + static int strict_v3 = FALSE; #define DVMRP_TYPE 0x13 @@ -336,7 +339,7 @@ dissect_dvmrp_v3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int "Unknown Type:0x%02x")); /* checksum */ - igmp_checksum(parent_tree, tvb, hf_checksum, hf_checksum_status, pinfo, 0); + igmp_checksum(parent_tree, tvb, hf_checksum, hf_checksum_status, &ei_checksum, pinfo, 0); offset += 2; /* skip unused byte */ @@ -525,7 +528,7 @@ dissect_dvmrp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int "Unknown Type:0x%02x")); /* checksum */ - igmp_checksum(parent_tree, tvb, hf_checksum, hf_checksum_status, pinfo, 0); + igmp_checksum(parent_tree, tvb, hf_checksum, hf_checksum_status, &ei_checksum, pinfo, 0); offset += 2; /* decode all the v1 commands */ @@ -883,11 +886,20 @@ proto_register_dvmrp(void) &ett_flags, &ett_route }; + + static ei_register_info ei[] = { + { &ei_checksum, { "dvmrp.bad_checksum", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL }}, + }; + + expert_module_t* expert_dvmrp; + module_t *module_dvmrp; proto_dvmrp = proto_register_protocol("Distance Vector Multicast Routing Protocol", "DVMRP", "dvmrp"); proto_register_field_array(proto_dvmrp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + expert_dvmrp = expert_register_protocol(proto_dvmrp); + expert_register_field_array(expert_dvmrp, ei, array_length(ei)); module_dvmrp = prefs_register_protocol(proto_dvmrp, NULL); |