summaryrefslogtreecommitdiff
path: root/epan
diff options
context:
space:
mode:
authorSimon Barber <simon.barber@meraki.net>2017-06-20 08:21:09 +0100
committerMichael Mann <mmann78@netscape.net>2017-06-20 10:56:57 +0000
commit3978462fd31665f30432689634812a15c476406b (patch)
tree745ce17684c3f05ff71255f3fea30141076db201 /epan
parent59670461b00414d504b2a9ed9e7bafeab65a7420 (diff)
downloadwireshark-3978462fd31665f30432689634812a15c476406b.tar.gz
ieee80211-radio: allow 0 duration and handle missing phy type
Allows duration to be calculated to 0 Handles generators where PHY type is not reported, but it can be determined from the rate. Change-Id: Ic0b9e1b0e3e51f4d5b670d25fea064daf250a55f Reviewed-on: https://code.wireshark.org/review/22261 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-ieee80211-radio.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ieee80211-radio.c b/epan/dissectors/packet-ieee80211-radio.c
index 73f1821c61..0a7a7a6fdb 100644
--- a/epan/dissectors/packet-ieee80211-radio.c
+++ b/epan/dissectors/packet-ieee80211-radio.c
@@ -466,7 +466,7 @@ dissect_wlan_radio_phdr (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
/* durations in microseconds */
guint preamble = 0, agg_preamble = 0; /* duration of plcp */
- guint duration = 0; /* duration of whole frame (plcp + mac data + any trailing parts) */
+ guint duration = G_MAXUINT; /* duration of whole frame (plcp + mac data + any trailing parts) */
guint prior_duration = 0; /* duration of previous part of aggregate */
struct wlan_radio *wlan_radio_info;
@@ -885,8 +885,18 @@ dissect_wlan_radio_phdr (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
data_rate == 5.5f || data_rate == 11.0f ||
data_rate == 22.0f || data_rate == 33.0f)) {
phy = PHDR_802_11_PHY_11B;
+ } else if (phy == PHDR_802_11_PHY_UNKNOWN &&
+ (data_rate == 1.0f || data_rate == 2.0f ||
+ data_rate == 5.5f || data_rate == 11.0f ||
+ data_rate == 22.0f || data_rate == 33.0f)) {
+ phy = PHDR_802_11_PHY_11B;
+ } else if (phy == PHDR_802_11_PHY_UNKNOWN &&
+ (data_rate == 6.0f || data_rate == 9.0f ||
+ data_rate == 12.0f || data_rate == 18.0f ||
+ data_rate == 24.0f || data_rate == 36.0f ||
+ data_rate == 48.0f || data_rate == 54.0f)) {
+ phy = PHDR_802_11_PHY_11A;
}
-
switch (phy) {
case PHDR_802_11_PHY_11_FHSS:
@@ -1069,7 +1079,7 @@ dissect_wlan_radio_phdr (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
}
}
- if (!pinfo->fd->flags.visited && duration && phdr->has_tsf_timestamp) {
+ if (!pinfo->fd->flags.visited && duration != G_MAXUINT && phdr->has_tsf_timestamp) {
if (current_aggregate) {
current_aggregate->duration = agg_preamble + prior_duration + duration;
if (previous_frame.radio_info && previous_frame.radio_info->aggregate == current_aggregate)
@@ -1117,7 +1127,7 @@ dissect_wlan_radio_phdr (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
}
}
- if (duration) {
+ if (duration != G_MAXUINT) {
proto_item *item = proto_tree_add_uint(radio_tree, hf_wlan_radio_duration, tvb, 0, 0, duration);
proto_tree *d_tree = proto_item_add_subtree(item, ett_wlan_radio_duration);
PROTO_ITEM_SET_GENERATED(item);