From 5429abd7c85d89b888f253243825435c295ddd48 Mon Sep 17 00:00:00 2001 From: Luis R. Rodriguez Date: Thu, 14 Jan 2010 13:27:46 -0500 Subject: [PATCH 7/8] cfg80211: Ingore country IEs with a zero set of number of channels commit a0f2e0fca1e72c1de07e834be05b61d33842253e upstream. Previous to this and the last patch, titled, "cfg80211: Fix 2 GHz subband calculation for country IEs" we would end up treating these IEs as single channel units. These are in fact just bogus IE triplets so ignore the entire IE if these are found. Signed-off-by: Luis R. Rodriguez Signed-off-by: John W. Linville --- net/wireless/reg.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 4a0cc27..71481e2 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -563,6 +563,9 @@ static int max_subband_chan(int orig_cur_chan, break; } + if (triplet->chans.num_channels == 0) + return 0; + /* Monitonically increasing channel order */ if (triplet->chans.first_channel <= end_subband_chan) return 0; @@ -715,6 +718,9 @@ static struct ieee80211_regdomain *country_ie_2_rd( break; } + if (triplet->chans.num_channels == 0) + return NULL; + /* 2 GHz */ if (triplet->chans.first_channel <= 14) end_channel = triplet->chans.first_channel + -- 1.6.3.3