Commit e99c7cd5 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

cfg80211: fix 2 GHz subband calculation for country IEs

Country IEs triplets are getting an extra channel with
the current count. This does not affect regulatory because
we always took the intersection between what the AP gave
and what CRDA believed is correct.

This however does fix processing some Country IEs with multiple
sequential 2 GHz triplets. Since our parser and the spec mandates
all channels be monitonically increasing we would drop the IE after
noticing the second triplet begins on a channel already processed.
APs that send these type of country IEs seems rare though.
Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6021e08d
...@@ -740,7 +740,7 @@ static struct ieee80211_regdomain *country_ie_2_rd( ...@@ -740,7 +740,7 @@ static struct ieee80211_regdomain *country_ie_2_rd(
/* 2 GHz */ /* 2 GHz */
if (triplet->chans.first_channel <= 14) if (triplet->chans.first_channel <= 14)
end_channel = triplet->chans.first_channel + end_channel = triplet->chans.first_channel +
triplet->chans.num_channels; triplet->chans.num_channels - 1;
else else
/* /*
* 5 GHz -- For example in country IEs if the first * 5 GHz -- For example in country IEs if the first
...@@ -863,7 +863,7 @@ static struct ieee80211_regdomain *country_ie_2_rd( ...@@ -863,7 +863,7 @@ static struct ieee80211_regdomain *country_ie_2_rd(
/* 2 GHz */ /* 2 GHz */
if (triplet->chans.first_channel <= 14) if (triplet->chans.first_channel <= 14)
end_channel = triplet->chans.first_channel + end_channel = triplet->chans.first_channel +
triplet->chans.num_channels; triplet->chans.num_channels -1;
else else
end_channel = triplet->chans.first_channel + end_channel = triplet->chans.first_channel +
(4 * (triplet->chans.num_channels - 1)); (4 * (triplet->chans.num_channels - 1));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment