aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-wisun.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-02-27 15:33:27 -0800
committerGuy Harris <guy@alum.mit.edu>2019-02-27 23:35:06 +0000
commit8fad9ba4472174dcb002ab7fb312d6e6969585d1 (patch)
treebcbe96f642969fcf8cda7c33e2094629c80a7bf3 /epan/dissectors/packet-wisun.c
parent4194678a1ccb246c0aa3870ebb46671f5f455e7a (diff)
Fix the FCS handling.
All the complicated stuff to see whether the captured data includes all of, some of, or none of the FCS is necessary, and should not have been removed. The previous code would sometimes dissect packet data at the end as both payload *and* FCS. This also means that the decryption code doesn't have to worry about the FCS, and expects the payload handed to it *not* to have the FCS. Update callers to handle that. This puts back the changes from e4d3916530aed332fcb39d4017e633bd51c4277c, for which the comment was: Clean up the way we handle the FCS. For the "802.15.4 with FCS" link-layer type, strip what FCS we find, if any, off and use that new tvbuff for all dissection except for checking and dissection of the FCS itself. For the "802.15.4 without FCS" link-layer type, don't fake an uncaptured FCS by increasing the reported length, just use the tvbuff as is. This means we handle 802.15.4 the same way we handle other link-layer types where the FCS might, or might not, appear as part of the captured data. "Handling stuff at the ends of packets is hard, let's go shopping!" Change-Id: Iaf3e8392efec9d1c35f73966e22f2a3ae91317a1 Reviewed-on: https://code.wireshark.org/review/32254 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-wisun.c')
-rw-r--r--epan/dissectors/packet-wisun.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/epan/dissectors/packet-wisun.c b/epan/dissectors/packet-wisun.c
index 5465faeee7..4cb6bd5fd8 100644
--- a/epan/dissectors/packet-wisun.c
+++ b/epan/dissectors/packet-wisun.c
@@ -1069,8 +1069,6 @@ static int dissect_wisun_netricity_sc(tvbuff_t *tvb, packet_info *pinfo, proto_t
pinfo->fragmented = save_fragmented;
} else {
- // the decryption function expects the tvb with the FCS as part of the reported length
- frame = tvb_new_subset_length_caplen(frame, 0, -1, tvb_reported_length(frame)+ieee802154_fcs_len);
tvbuff_t *payload = ieee802154_decrypt_payload(frame, mhr_len, pinfo, ieee802154_tree, packet);
if (payload) {
guint pie_size = ieee802154_dissect_payload_ies(payload, pinfo, ieee802154_tree, packet);