aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-ieee80211-radiotap.c7
-rw-r--r--epan/dissectors/packet-ppi.c7
2 files changed, 14 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) {
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),