aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ieee80211-radiotap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-10-05 23:46:53 -0700
committerGuy Harris <guy@alum.mit.edu>2015-10-06 06:48:13 +0000
commite8d0bf8a5b7962d155586583d7f769a6b03f51bf (patch)
tree15276187a709d1f99cef7ca29cc30d19aa0922d3 /epan/dissectors/packet-ieee80211-radiotap.c
parentbe187b99c77a06af49a25156f32a9d536788bbf1 (diff)
Calculate the channel if we have only the frequency.
That way, the generic 802.11 radio dissector, and any future taps if we add a tap with radio information, can get the channel for radiotap and PPI headers, as we do for some other radio headers that supply just a frequency. Change-Id: I9e3037f69938bed3b3ba563689ff00aaed486a16 Reviewed-on: https://code.wireshark.org/review/10821 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-ieee80211-radiotap.c')
-rw-r--r--epan/dissectors/packet-ieee80211-radiotap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c
index d4956ed51e..74c64cbab5 100644
--- a/epan/dissectors/packet-ieee80211-radiotap.c
+++ b/epan/dissectors/packet-ieee80211-radiotap.c
@@ -940,8 +940,15 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
* XXX - some captures have 0, which is
* obviously bogus.
*/
+ gint calc_channel;
+
phdr.presence_flags |= PHDR_802_11_HAS_FREQUENCY;
phdr.frequency = freq;
+ calc_channel = ieee80211_mhz_to_chan(freq);
+ if (calc_channel != -1) {
+ phdr.presence_flags |= PHDR_802_11_HAS_CHANNEL;
+ phdr.channel = calc_channel;
+ }
}
cflags = tvb_get_letohs(tvb, offset + 2);
switch (cflags & IEEE80211_CHAN_ALLTURBO) {