ieee80211: Make DMG Capabilities dissection handle earlier formats

The recent changes to support the current 22-byte DMC Capabilities IE
defined in IEEE802.11-2012 prevents Wireshark from handling frames
in the earlier format.

This change allows Wireshark to dissect both the earlier and current
formats but gives an error if the IE does not have a length of 22.

The error could perhaps be demoted to a warning.

Also made a minor correction to the header fields to conform with
other uses.

Bug: 14727
Change-Id: I3dc333b273f915fa5f5f4cc5c13c1b84863b6713
Reviewed-on: https://code.wireshark.org/review/27782
Petri-Dish: Richard Sharpe <realrichardsharpe@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
Richard Sharpe 2018-05-24 09:33:43 -07:00 committed by Alexis La Goutte
parent ca434b16d5
commit c4c5ad2686
1 changed files with 22 additions and 6 deletions

View File

@ -19470,9 +19470,13 @@ ieee80211_tag_dmg_capabilities(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
NULL
};
if (tag_len != 22)
/*
* Plenty of devices still do not conform to the older version of this
* field. So, it must be at least 17 bytes in length.
*/
if (tag_len < 17)
{
expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 22", tag_len);
expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must contain at least 17 bytes", tag_len);
return tvb_captured_length(tvb);
}
@ -19488,6 +19492,18 @@ ieee80211_tag_dmg_capabilities(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
offset += 2;
proto_tree_add_bitmask_list(tree, tvb, offset, 2, ieee80211_tag_dmg_cap4, ENC_LITTLE_ENDIAN);
offset += 2;
/*
* There are many captures out there that do not conform to the 2016
* version, so give them a malformed IE message now after we have dissected
* the above
*/
if (tag_len != 22)
{
expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u does not conform to IEEE802.11-2016, should contain 22 bytes", tag_len);
return tvb_captured_length(tvb);
}
proto_tree_add_item(tree, hf_ieee80211_tag_sta_beam_track, tvb, offset, 2, ENC_NA);
offset += 2;
proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_dmg_cap5, ENC_LITTLE_ENDIAN);
@ -24778,8 +24794,8 @@ proto_register_ieee80211(void)
NULL, HFILL }},
{&hf_ieee80211_tag_ext_sc_mcs_tx_code_7_8, /* DMG STA Ext SC MCS Capa: Tx code rate 7/8*/
{"Extended SC Tx MCS code rate 7/8 supported", "wlan.dmg_capa.ext_sc_mcs_tx_code_7_8",
FT_BOOLEAN, 8, NULL, GENMASK(3, 3),
{"Extended SC Tx MCS code rate 7/8", "wlan.dmg_capa.ext_sc_mcs_tx_code_7_8",
FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), GENMASK(3, 3),
NULL, HFILL }},
{&hf_ieee80211_tag_ext_sc_mcs_max_rx, /* DMG STA Ext SC MCS Capa: Max RX*/
@ -24788,8 +24804,8 @@ proto_register_ieee80211(void)
NULL, HFILL }},
{&hf_ieee80211_tag_ext_sc_mcs_rx_code_7_8, /* DMG STA Ext SC MCS Capa: Rx code rate 7/8*/
{"Extended SC Rx MCS code rate 7/8 suported", "wlan.dmg_capa.ext_sc_mcs_rx_code_7_8",
FT_BOOLEAN, 8, NULL, GENMASK(7, 7),
{"Extended SC Rx MCS code rate 7/8", "wlan.dmg_capa.ext_sc_mcs_rx_code_7_8",
FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), GENMASK(7, 7),
NULL, HFILL }},
{&hf_ieee80211_tag_max_basic_sf_amsdu, /* DMG Max Number of Basic Subframes in an A-MSDU*/