]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
cfg80211: Ingore country IEs with a zero set of number of channels
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Thu, 14 Jan 2010 18:27:46 +0000 (13:27 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 14 Jan 2010 23:16:56 +0000 (18:16 -0500)
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 <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/reg.c

index f0859eada758329053897c1c4a5e57e9cb9ad36f..f3b77f7b8e3d2aa4303b87f916b2ffeb882a7d8f 100644 (file)
@@ -585,6 +585,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;
@@ -737,6 +740,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 +