diff options
author | Devan Lai <devanl@davisinstruments.com> | 2019-09-20 14:34:27 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2019-10-03 07:51:53 +0000 |
commit | b5091d8cd800c6ab35c0af4f5f4e056d138eb0bf (patch) | |
tree | 0c049942f6cdb1e1628d2b9bd35490e5a401ae88 | |
parent | 79c8b446b67d71c6e61a2de934769228c5ace0db (diff) |
ieee802154: handle IEEE 802.15.4e PAN ID compression
Add a new 802154e_compatibility preference.
When enabled, it will attempt to handle certain PAN ID compression schemes
that are permitted in 802.15.4e-2012 but not in 802.15.4-2015.
Specifically, when either the source or destination address are present
in short form and the PAN ID Compression bit is cleared, 802.15.4-2015 expects
the source PAN ID to be present, whereas 802.15.4e-2012 does not.
Bug: 16102
Change-Id: I7fea7bd6d0a78c859360a1130b242e90eac8feec
Reviewed-on: https://code.wireshark.org/review/34683
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-ieee802154.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c index df78de40a6..d2bf64030e 100644 --- a/epan/dissectors/packet-ieee802154.c +++ b/epan/dissectors/packet-ieee802154.c @@ -158,6 +158,9 @@ static gboolean ieee802154_fcs_ok = TRUE; /* boolean value set to enable ack tracking */ static gboolean ieee802154_ack_tracking = FALSE; +/* boolean value set to enable 802.15.4e dissection compatibility */ +static gboolean ieee802154e_compatibility = FALSE; + /* TSCH ASN for nonce in decryption */ static guint64 ieee802154_tsch_asn = 0; @@ -2328,21 +2331,21 @@ ieee802154_dissect_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g (packet->src_addr_mode == IEEE802154_FCF_ADDR_SHORT) && /* Short */ (packet->pan_id_compression == 0)) { dstPanPresent = TRUE; - srcPanPresent = TRUE; + srcPanPresent = (ieee802154e_compatibility ? FALSE : TRUE); } /* Row 10 */ else if ((packet->dst_addr_mode == IEEE802154_FCF_ADDR_SHORT) && /* Short */ (packet->src_addr_mode == IEEE802154_FCF_ADDR_EXT) && /* Extended */ (packet->pan_id_compression == 0)) { dstPanPresent = TRUE; - srcPanPresent = TRUE; + srcPanPresent = (ieee802154e_compatibility ? FALSE : TRUE); } /* Row 11 */ else if ((packet->dst_addr_mode == IEEE802154_FCF_ADDR_EXT) && /* Extended */ (packet->src_addr_mode == IEEE802154_FCF_ADDR_SHORT) && /* Short */ (packet->pan_id_compression == 0)) { dstPanPresent = TRUE; - srcPanPresent = TRUE; + srcPanPresent = (ieee802154e_compatibility ? FALSE : TRUE); } /* Row 12 */ else if ((packet->dst_addr_mode == IEEE802154_FCF_ADDR_SHORT) && /* Short */ @@ -6579,6 +6582,10 @@ void proto_register_ieee802154(void) "Enable ACK tracking", "Match frames with ACK request to ACK packets", &ieee802154_ack_tracking); + prefs_register_bool_preference(ieee802154_module, "802154e_compatibility", + "Assume 802.15.4e-2012 for compatibility", + "Parse assuming 802.15.4e quirks for compatibility", + &ieee802154e_compatibility); /* Create a UAT for static address mappings. */ static_addr_uat = uat_new("Static Addresses", |