diff options
author | Joerg Mayer <jmayer@loplof.de> | 2018-05-07 15:20:08 +0200 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2018-05-07 13:22:23 +0000 |
commit | c9832726bfae1e86891581f3d072537b9eb14ea7 (patch) | |
tree | 765502ff3ca56743b364ccd11e67f95dfa9c8c7a | |
parent | fc5ebe217fc2712b60dfaa5d96b66386a041dd42 (diff) |
Refer to the bytes of the real checksum field if the checksum is missing or generated
Change-Id: I6c7a5b1441b97604d2847f7b74abc7a9c9e98d2c
Reviewed-on: https://code.wireshark.org/review/27381
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
-rw-r--r-- | epan/proto.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/epan/proto.c b/epan/proto.c index fa83e710fd..a0053a5d4c 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -11966,16 +11966,6 @@ proto_tree_add_checksum(proto_tree *tree, tvbuff_t *tvb, const guint offset, DISSECTOR_ASSERT_HINT(hfinfo != NULL, "Not passed hfi!"); - if (flags & PROTO_CHECKSUM_NOT_PRESENT) { - ti = proto_tree_add_uint_format_value(tree, hf_checksum, tvb, offset, 0, 0, "[missing]"); - PROTO_ITEM_SET_GENERATED(ti); - if (hf_checksum_status != -1) { - ti2 = proto_tree_add_uint(tree, hf_checksum_status, tvb, offset, 0, PROTO_CHECKSUM_E_NOT_PRESENT); - PROTO_ITEM_SET_GENERATED(ti2); - } - return ti; - } - switch (hfinfo->type) { case FT_UINT8: len = 1; @@ -11993,8 +11983,18 @@ proto_tree_add_checksum(proto_tree *tree, tvbuff_t *tvb, const guint offset, DISSECTOR_ASSERT_NOT_REACHED(); } + if (flags & PROTO_CHECKSUM_NOT_PRESENT) { + ti = proto_tree_add_uint_format_value(tree, hf_checksum, tvb, offset, len, 0, "[missing]"); + PROTO_ITEM_SET_GENERATED(ti); + if (hf_checksum_status != -1) { + ti2 = proto_tree_add_uint(tree, hf_checksum_status, tvb, offset, len, PROTO_CHECKSUM_E_NOT_PRESENT); + PROTO_ITEM_SET_GENERATED(ti2); + } + return ti; + } + if (flags & PROTO_CHECKSUM_GENERATED) { - ti = proto_tree_add_uint(tree, hf_checksum, tvb, offset, 0, computed_checksum); + ti = proto_tree_add_uint(tree, hf_checksum, tvb, offset, len, computed_checksum); PROTO_ITEM_SET_GENERATED(ti); } else { ti = proto_tree_add_item_ret_uint(tree, hf_checksum, tvb, offset, len, encoding, &checksum); |