aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Badea <abadea@ixiacom.com>2016-11-17 16:46:16 +0200
committerMichael Mann <mmann78@netscape.net>2016-11-20 03:42:22 +0000
commit6bd322223d3f13612a449cbba20ce36e9da30ebb (patch)
tree3e1a0c6fd95e081b78d7c7945b6cb2d9f3d28dd6
parentabf802baf77bca3c0b4f94e81e8308b4c2d527fb (diff)
tcp: fix "calculated checksum" tree item for bad checksums
The Calculated Checksum tree item prints the checksum from the tvb, instead of the computed one (the "should be 0x...." tree item above it _does_ print the computed one). As such, in a packet with bad checksum, the Calculated Checksum is incorrect. Fix the value. This seems to have been introduced in ad6fc87d ("Add proto_tree_add_checksum.") Change-Id: Ia20d5addc40956713a944102e79d25317b969a0e Reviewed-on: https://code.wireshark.org/review/18859 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-tcp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index bcc9732eae..43cd8b1ba8 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -6151,7 +6151,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY|PROTO_CHECKSUM_IN_CKSUM);
calc_item = proto_tree_add_uint(tcp_tree, hf_tcp_checksum_calculated, tvb,
- offset + 16, 2, th_sum);
+ offset + 16, 2, in_cksum_shouldbe(th_sum, computed_cksum));
PROTO_ITEM_SET_GENERATED(calc_item);
/* Checksum is valid, so we're willing to desegment it. */