Skip to content

Commit

Permalink
cfg80211: fix 2 GHz subband calculation for country IEs
Browse files Browse the repository at this point in the history
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: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Jan 14, 2010
1 parent 6021e08 commit e99c7cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ static struct ieee80211_regdomain *country_ie_2_rd(
/* 2 GHz */
if (triplet->chans.first_channel <= 14)
end_channel = triplet->chans.first_channel +
triplet->chans.num_channels;
triplet->chans.num_channels - 1;
else
/*
* 5 GHz -- For example in country IEs if the first
Expand Down Expand Up @@ -863,7 +863,7 @@ static struct ieee80211_regdomain *country_ie_2_rd(
/* 2 GHz */
if (triplet->chans.first_channel <= 14)
end_channel = triplet->chans.first_channel +
triplet->chans.num_channels;
triplet->chans.num_channels -1;
else
end_channel = triplet->chans.first_channel +
(4 * (triplet->chans.num_channels - 1));
Expand Down

0 comments on commit e99c7cd

Please sign in to comment.