diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-10-05 23:46:53 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-10-06 06:48:13 +0000 |
commit | e8d0bf8a5b7962d155586583d7f769a6b03f51bf (patch) | |
tree | 15276187a709d1f99cef7ca29cc30d19aa0922d3 /epan/dissectors/packet-ppi.c | |
parent | be187b99c77a06af49a25156f32a9d536788bbf1 (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-ppi.c')
-rw-r--r-- | epan/dissectors/packet-ppi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ppi.c b/epan/dissectors/packet-ppi.c index 2db066a2fb..0fd7ebd03d 100644 --- a/epan/dissectors/packet-ppi.c +++ b/epan/dissectors/packet-ppi.c @@ -525,8 +525,15 @@ dissect_80211_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of common_frequency = tvb_get_letohs(ptvcursor_tvbuff(csr), ptvcursor_current_offset(csr)); if (common_frequency != 0) { + gint calc_channel; + phdr->presence_flags |= PHDR_802_11_HAS_FREQUENCY; phdr->frequency = common_frequency; + calc_channel = ieee80211_mhz_to_chan(common_frequency); + if (calc_channel != -1) { + phdr->presence_flags |= PHDR_802_11_HAS_CHANNEL; + phdr->channel = calc_channel; + } } chan_str = ieee80211_mhz_to_str(common_frequency); proto_tree_add_uint_format_value(ptvcursor_tree(csr), hf_80211_common_chan_freq, ptvcursor_tvbuff(csr), |