aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-11-05 12:18:07 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-11-25 14:51:14 -0500
commit2f1c6c572d7b6cbe2e3c9bbb427769f6c79089bb (patch)
tree116b7e4fff8d5296573031ff51ec142fd2d6073e /net
parentb23e7a9e6b1f4c3070f9ce59e82b9dff69b11fe1 (diff)
cfg80211: process non country IE conflicting first
By dealing with non country IE conficts first we can shift the code that deals with the conflict to the left. This has no functional changes. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/reg.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index aef39243595a..875fffc284c0 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1539,31 +1539,32 @@ __reg_process_hint_country_ie(struct wiphy *wiphy,
1539 return REG_REQ_ALREADY_SET; 1539 return REG_REQ_ALREADY_SET;
1540 } 1540 }
1541 1541
1542 last_wiphy = wiphy_idx_to_wiphy(lr->wiphy_idx);
1543
1544 if (unlikely(!is_an_alpha2(country_ie_request->alpha2))) 1542 if (unlikely(!is_an_alpha2(country_ie_request->alpha2)))
1545 return -EINVAL; 1543 return -EINVAL;
1546 if (lr->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) { 1544
1547 if (last_wiphy != wiphy) { 1545 if (lr->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE)
1548 /* 1546 return REG_REQ_OK;
1549 * Two cards with two APs claiming different 1547
1550 * Country IE alpha2s. We could 1548 last_wiphy = wiphy_idx_to_wiphy(lr->wiphy_idx);
1551 * intersect them, but that seems unlikely 1549
1552 * to be correct. Reject second one for now. 1550 if (last_wiphy != wiphy) {
1553 */
1554 if (regdom_changes(country_ie_request->alpha2))
1555 return REG_REQ_IGNORE;
1556 return REG_REQ_ALREADY_SET;
1557 }
1558 /* 1551 /*
1559 * Two consecutive Country IE hints on the same wiphy. 1552 * Two cards with two APs claiming different
1560 * This should be picked up early by the driver/stack 1553 * Country IE alpha2s. We could
1554 * intersect them, but that seems unlikely
1555 * to be correct. Reject second one for now.
1561 */ 1556 */
1562 if (WARN_ON(regdom_changes(country_ie_request->alpha2))) 1557 if (regdom_changes(country_ie_request->alpha2))
1563 return REG_REQ_OK; 1558 return REG_REQ_IGNORE;
1564 return REG_REQ_ALREADY_SET; 1559 return REG_REQ_ALREADY_SET;
1565 } 1560 }
1566 return REG_REQ_OK; 1561 /*
1562 * Two consecutive Country IE hints on the same wiphy.
1563 * This should be picked up early by the driver/stack
1564 */
1565 if (WARN_ON(regdom_changes(country_ie_request->alpha2)))
1566 return REG_REQ_OK;
1567 return REG_REQ_ALREADY_SET;
1567} 1568}
1568 1569
1569/** 1570/**