From 8aaf42d2b11b993d54283a5944841813a06881d5 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 28 Jun 2015 10:28:38 -0700 Subject: If we don't know whether STBC is being used, we don't know NSTS. If we don't know whether space-time block coding is being used, we don't know the number of space-time streams, so don't try to calculate it and don't put it into the protocol tree. Mark it as generated, while we're at it, as it's not a value from the radiotap header, and make it a guint. Change-Id: Ib0b14f2f4f94e042d034311e10bb96b9b29a9d3e Reviewed-on: https://code.wireshark.org/review/9206 Reviewed-by: Guy Harris --- epan/dissectors/packet-ieee80211-radiotap.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'epan/dissectors/packet-ieee80211-radiotap.c') diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c index cd0dcd2da4..58452aae13 100644 --- a/epan/dissectors/packet-ieee80211-radiotap.c +++ b/epan/dissectors/packet-ieee80211-radiotap.c @@ -1525,7 +1525,7 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) case IEEE80211_RADIOTAP_VHT: { proto_item *it, *it_root = NULL; proto_tree *vht_tree = NULL, *vht_known_tree = NULL, *user_tree = NULL; - guint16 known, nsts; + guint16 known; guint8 vht_flags, bw, mcs_nss; guint bandwidth = 0; guint gi_length = 0; @@ -1661,11 +1661,6 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) phdr.phy_info.info_11ac.mcs[i] = mcs; phdr.phy_info.info_11ac.nss[i] = nss; - if ((known & IEEE80211_RADIOTAP_VHT_HAVE_STBC) && (vht_flags & IEEE80211_RADIOTAP_VHT_STBC)) - nsts = 2 * nss; - else - nsts = nss; - if (nss) { if (vht_tree) { it = proto_tree_add_item(vht_tree, hf_radiotap_vht_user, @@ -1686,8 +1681,18 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item(user_tree, hf_radiotap_vht_nss[i], tvb, offset + 4 + i, 1, ENC_LITTLE_ENDIAN); - proto_tree_add_uint(user_tree, hf_radiotap_vht_nsts[i], - tvb, offset + 4 + i, 1, nsts); + if (known & IEEE80211_RADIOTAP_VHT_HAVE_STBC) { + guint nsts; + proto_item *nsts_ti; + + if (vht_flags & IEEE80211_RADIOTAP_VHT_STBC) + nsts = 2 * nss; + else + nsts = nss; + nsts_ti = proto_tree_add_uint(user_tree, hf_radiotap_vht_nsts[i], + tvb, offset + 4 + i, 1, nsts); + PROTO_ITEM_SET_GENERATED(nsts_ti); + } proto_tree_add_item(user_tree, hf_radiotap_vht_coding[i], tvb, offset + 8, 1,ENC_LITTLE_ENDIAN); } -- cgit v1.2.3