From 6d6f49d2948dceec9dfb3124833a617f28dda3a3 Mon Sep 17 00:00:00 2001 From: Chris Brandson Date: Wed, 17 Feb 2016 11:23:16 -0800 Subject: [PATCH] 802.15.4 fixed processing of PAN ID compression bit This the result of updated 'PAN ID Compression field value for frame version 0b10' table in IEEE spec which clarifies the interpretaion of the PAN ID Compression bits for different combinations of Src and Dst Addresses. Change-Id: Ia70836b8571beae80a3f507be4f39736e13eb110 Reviewed-on: https://code.wireshark.org/review/13984 Reviewed-by: Alexis La Goutte Petri-Dish: Alexis La Goutte Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin --- epan/dissectors/packet-ieee802154.c | 34 ++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c index 1509988517..5335df6fc0 100644 --- a/epan/dissectors/packet-ieee802154.c +++ b/epan/dissectors/packet-ieee802154.c @@ -876,10 +876,21 @@ dissect_ieee802154_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g } } else { /* Frame Version 0b10 */ - if (packet->pan_id_compression == 0) { - srcPanPresent = TRUE; + if ((packet->src_addr_mode == IEEE802154_FCF_ADDR_EXT) && + (packet->dst_addr_mode == IEEE802154_FCF_ADDR_EXT)) { + if (packet->pan_id_compression == 0) { + dstPanPresent = TRUE; + } + } + else { + if (packet->pan_id_compression == 1) { + dstPanPresent = TRUE; + } + else { + dstPanPresent = TRUE; + srcPanPresent = TRUE; + } } - /* else neither present */ } } } @@ -916,10 +927,21 @@ dissect_ieee802154_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g } } else { /* Frame Version 0b10 */ - if (packet->pan_id_compression == 0) { - dstPanPresent = TRUE; + if ((packet->src_addr_mode == IEEE802154_FCF_ADDR_EXT) && + (packet->dst_addr_mode == IEEE802154_FCF_ADDR_EXT)) { + if (packet->pan_id_compression == 0) { + dstPanPresent = TRUE; + } + } + else { + if (packet->pan_id_compression == 1) { + dstPanPresent = TRUE; + } + else { + dstPanPresent = TRUE; + srcPanPresent = TRUE; + } } - /* else neither PAN Ids */ } } }