aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gre.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-07-21 10:21:25 -0400
committerAnders Broman <a.broman58@gmail.com>2016-07-27 03:40:02 +0000
commit8b0e9c66728f6a39bbe3ada1029e13ad1378013a (patch)
treec0c1b4da1845069520d4e131db96e6143e4ca772 /epan/dissectors/packet-gre.c
parentb7f1e99f7f4c75fa4bac1ccba77087fb0e50b8ac (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-gre.c')
-rw-r--r--epan/dissectors/packet-gre.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/epan/dissectors/packet-gre.c b/epan/dissectors/packet-gre.c
index 4d60a57370..3fdcff0835 100644
--- a/epan/dissectors/packet-gre.c
+++ b/epan/dissectors/packet-gre.c
@@ -59,6 +59,7 @@ static int hf_gre_flags_reserved_ppp = -1;
static int hf_gre_flags_reserved = -1;
static int hf_gre_flags_version = -1;
static int hf_gre_checksum = -1;
+static int hf_gre_checksum_status = -1;
static int hf_gre_offset = -1;
static int hf_gre_key = -1;
static int hf_gre_key_payload_length = -1;
@@ -419,10 +420,10 @@ dissect_gre(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
fragmented datagram and isn't truncated, so we can checksum it. */
if ((flags_and_ver & GRE_CHECKSUM) && !pinfo->fragmented && length >= reported_length) {
SET_CKSUM_VEC_TVB(cksum_vec[0], tvb, 0, reported_length);
- proto_tree_add_checksum(gre_tree, tvb, offset, hf_gre_checksum, -1, &ei_gre_checksum_incorrect, pinfo, in_cksum(cksum_vec, 1),
+ proto_tree_add_checksum(gre_tree, tvb, offset, hf_gre_checksum, hf_gre_checksum_status, &ei_gre_checksum_incorrect, pinfo, in_cksum(cksum_vec, 1),
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY|PROTO_CHECKSUM_IN_CKSUM);
} else {
- proto_tree_add_checksum(gre_tree, tvb, offset, hf_gre_checksum, -1, &ei_gre_checksum_incorrect, pinfo, 0,
+ proto_tree_add_checksum(gre_tree, tvb, offset, hf_gre_checksum, hf_gre_checksum_status, &ei_gre_checksum_incorrect, pinfo, 0,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
}
offset += 2;
@@ -583,6 +584,11 @@ proto_register_gre(void)
FT_UINT16, BASE_HEX, NULL, 0x0,
"The Checksum field contains the IP (one's complement) checksum of the GRE header and the payload packet", HFILL }
},
+ { &hf_gre_checksum_status,
+ { "Checksum Status", "gre.checksum.status",
+ FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0,
+ NULL, HFILL }
+ },
{ &hf_gre_offset,
{ "Offset", "gre.offset",
FT_UINT16, BASE_DEC, NULL, 0x0,