aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-eigrp.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-07-10 23:47:28 -0400
committerMichael Mann <mmann78@netscape.net>2016-07-21 12:35:22 +0000
commitad6fc87d64de30cdcdca18168a117d2ec24591da (patch)
treeb5df109654ae6806db7544933f8bf1a848a02ae7 /epan/dissectors/packet-eigrp.c
parent1e19f55f0c44b850bc6304be28d5b272a3553204 (diff)
Add proto_tree_add_checksum.
This is an attempt to standardize display/handling of checksum fields for all dissectors. The main target is for dissectors that do validation, but dissectors that just report the checksum were also included just to make them easier to find in the future. Bug: 10620 Bug: 12058 Ping-Bug: 8859 Change-Id: Ia8abd86e42eaf8ed50de6b173409e914b17993bf Reviewed-on: https://code.wireshark.org/review/16380 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-eigrp.c')
-rw-r--r--epan/dissectors/packet-eigrp.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/epan/dissectors/packet-eigrp.c b/epan/dissectors/packet-eigrp.c
index b42d23d1e3..a925930b6e 100644
--- a/epan/dissectors/packet-eigrp.c
+++ b/epan/dissectors/packet-eigrp.c
@@ -2416,9 +2416,9 @@ static int
dissect_eigrp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
proto_item *ti;
- proto_tree *eigrp_tree = NULL, *tlv_tree;
+ proto_tree *eigrp_tree, *tlv_tree;
guint opcode, vrid;
- guint16 tlv, checksum, cacl_checksum;
+ guint16 tlv;
guint32 ack, size, offset = EIGRP_HEADER_LENGTH;
/* Make entries in Protocol column and Info column on summary display */
@@ -2463,18 +2463,7 @@ dissect_eigrp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
ENC_BIG_ENDIAN);
size = tvb_captured_length(tvb);
- checksum = tvb_get_ntohs(tvb, 2);
- cacl_checksum = ip_checksum_tvb(tvb, 0, size);
-
- if (cacl_checksum == checksum) {
- proto_tree_add_uint_format_value(eigrp_tree, hf_eigrp_checksum, tvb, 2, 2,
- checksum, "0x%02x [incorrect]",
- checksum);
- expert_add_info(pinfo, ti, &ei_eigrp_checksum_bad);
- } else {
- proto_tree_add_uint_format_value(eigrp_tree, hf_eigrp_checksum, tvb, 2, 2,
- checksum, "0x%02x [correct]", checksum);
- }
+ proto_tree_add_checksum(eigrp_tree, tvb, 2, hf_eigrp_checksum, -1, &ei_eigrp_checksum_bad, pinfo, ip_checksum_tvb(tvb, 0, size), ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
/* Decode the EIGRP Flags Field */
proto_tree_add_bitmask(eigrp_tree, tvb, 4, hf_eigrp_flags, ett_eigrp_flags,