Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122269
b: refs/heads/master
c: b8295ac
h: refs/heads/master
i:
  122267: 3268f47
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Nov 25, 2008
1 parent a43e92a commit 14ab80b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8375af3ba213154041cfbc655f452913f23bfbd5
refs/heads/master: b8295acdc323e6e383ec822fc1e95edeb9148513
29 changes: 21 additions & 8 deletions trunk/net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,27 +826,40 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
if (WARN_ON(!reg_is_valid_request(rd->alpha2)))
return -EINVAL;

reset_regdomains();

/* Country IE parsing coming soon */

if (!is_valid_rd(rd)) {
printk(KERN_ERR "cfg80211: Invalid "
"regulatory domain detected:\n");
print_regdomain_info(rd);
return -EINVAL;
}

if (unlikely(last_request->intersect)) {
if (!last_request->intersect) {
reset_regdomains();
cfg80211_regdomain = rd;
return 0;
}

/* Intersection requires a bit more work */

if (last_request->initiator != REGDOM_SET_BY_COUNTRY_IE) {

intersected_rd = regdom_intersect(rd, cfg80211_regdomain);
if (!intersected_rd)
return -EINVAL;

/* We can trash what CRDA provided now */
kfree(rd);
rd = intersected_rd;
rd = NULL;

reset_regdomains();
cfg80211_regdomain = intersected_rd;

return 0;
}

/* Tada! */
cfg80211_regdomain = rd;
/* Country IE parsing coming soon */
reset_regdomains();
WARN_ON(1);

return 0;
}
Expand Down

0 comments on commit 14ab80b

Please sign in to comment.