cfg80211: allow only the core to request to update the world regdom
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Tue, 5 Nov 2013 17:18:11 +0000 (09:18 -0800)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 Nov 2013 19:51:23 +0000 (20:51 +0100)
It seems some out of tree drivers were using a regulatory_hint("00")
to trigger off the wiphy regulatory notifier, for those cases just
setting the WIPHY_FLAG_CUSTOM_REGULATORY would suffice to call
the reg_notifier() for a world regulatory domain update. If drivers
find other needs for calling the reg_notifier() a proper implemenation
is preferred.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/reg.c

index 130cfdaa7f4cf76e732b773d69c9087262c785c6..cd50bb56c7e75599c970e59f03a07cab5f7fa787 100644 (file)
@@ -2200,6 +2200,8 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
                return -EINVAL;
 
        if (is_world_regdom(rd->alpha2)) {
+               if (lr->initiator != NL80211_REGDOM_SET_BY_CORE)
+                       return -EINVAL;
                update_world_regdomain(rd);
                return 0;
        }