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-mrdisc.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-mrdisc.c')
-rw-r--r-- | epan/dissectors/packet-mrdisc.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/epan/dissectors/packet-mrdisc.c b/epan/dissectors/packet-mrdisc.c index 45fa7f4349..8268bae7c4 100644 --- a/epan/dissectors/packet-mrdisc.c +++ b/epan/dissectors/packet-mrdisc.c @@ -37,7 +37,7 @@ #include "config.h" #include <epan/packet.h> -#include <epan/exceptions.h> +#include <epan/expert.h> #include "packet-igmp.h" @@ -60,6 +60,8 @@ static int hf_option_bytes = -1; static int ett_mrdisc = -1; static int ett_options = -1; +static expert_field ei_checksum = EI_INIT; + #define MC_ALL_ROUTERS 0xe0000002 #define MRDISC_MRA 0x24 @@ -91,7 +93,7 @@ dissect_mrdisc_mra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, i offset += 1; /* 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 bytes */ @@ -160,7 +162,7 @@ dissect_mrdisc_mrst(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, offset += 1; /* 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; return offset; @@ -179,7 +181,7 @@ dissect_mrdisc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* /* Shouldn't be destined for us */ if (memcmp(pinfo->dst.data, &dst, 4)) - return 0; + return 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "MRDISC"); col_clear(pinfo->cinfo, COL_INFO); @@ -264,9 +266,17 @@ proto_register_mrdisc(void) &ett_options, }; + static ei_register_info ei[] = { + { &ei_checksum, { "mrdisc.bad_checksum", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL }}, + }; + + expert_module_t* expert_mrdisc; + proto_mrdisc = proto_register_protocol("Multicast Router DISCovery protocol", "MRDISC", "mrdisc"); proto_register_field_array(proto_mrdisc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + expert_mrdisc = expert_register_protocol(proto_mrdisc); + expert_register_field_array(expert_mrdisc, ei, array_length(ei)); } void |