aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ieee802154.c
diff options
context:
space:
mode:
authordsrsupport <eugene.exarevsky@dsr-company.com>2016-07-13 12:40:54 +0300
committerMichael Mann <mmann78@netscape.net>2016-07-13 15:08:23 +0000
commit0b000977b74f0c8e1b042ed51749e801fa81f426 (patch)
treeba808a8747d45f2d6ae9fa1aa52edfb6478b20a2 /epan/dissectors/packet-ieee802154.c
parent3ecbe50af2e904709f805ff6e8f3803842fcfe6f (diff)
ZigBee MAC parse: fix Association request parse in case of FCS absence.
If it is ok to parse packets with bas FSC, FCS may be even absent. Parse MAC command even if remaining buffer length is less that FCS size in such case. Change-Id: Ibbc9fed7ab87d0511f8c97db8e0e3bdf562cd15c Reviewed-on: https://code.wireshark.org/review/16412 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-ieee802154.c')
-rw-r--r--epan/dissectors/packet-ieee802154.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c
index b7606a0a98..36b0d0d835 100644
--- a/epan/dissectors/packet-ieee802154.c
+++ b/epan/dissectors/packet-ieee802154.c
@@ -720,10 +720,19 @@ static int
dissect_ieee802154(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
tvbuff_t *new_tvb = dissect_zboss_specific(tvb, pinfo, tree);
+ guint options = 0;
+ if (ieee802154_cc24xx)
+ {
+ options = DISSECT_IEEE802154_OPTION_CC24xx;
+ }
+ if (new_tvb != tvb)
+ {
+ /* ZBOSS traffic dump: always TI FCS, always ZigBee */
+ options = (DISSECT_IEEE802154_OPTION_CC24xx | DISSECT_IEEE802154_OPTION_ZBOSS);
+ }
/* Call the common dissector. */
- dissect_ieee802154_common(new_tvb, pinfo, tree,
- ((ieee802154_cc24xx || new_tvb != tvb) ? (DISSECT_IEEE802154_OPTION_CC24xx | DISSECT_IEEE802154_OPTION_ZBOSS) : 0));
+ dissect_ieee802154_common(new_tvb, pinfo, tree, options);
return tvb_captured_length(tvb);
} /* dissect_ieee802154 */
@@ -1484,7 +1493,12 @@ dissect_ieee802154_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
}
}
- if (tvb_captured_length_remaining(tvb, offset) > IEEE802154_FCS_LEN) {
+ /* If it is ok to dissect bad FCS, FCS might be absent, so still dissect
+ * commands like Association request. */
+ if ((!ieee802154_fcs_ok
+ /* If either ZBOSS traffic dump or TI CC2{45}xx, FCS must be present. */
+ && !(options & (DISSECT_IEEE802154_OPTION_ZBOSS | DISSECT_IEEE802154_OPTION_CC24xx)))
+ || tvb_captured_length_remaining(tvb, offset) > IEEE802154_FCS_LEN) {
/*
* Wrap the sub-dissection in a try/catch block in case the payload is
* broken. First we store the current protocol so we can fix it if an