Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134923
b: refs/heads/master
c: 80778f1
h: refs/heads/master
i:
  134921: df7f79d
  134919: fef44ce
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Feb 27, 2009
1 parent df42c50 commit af4a1a4
Show file tree
Hide file tree
Showing 2 changed files with 27 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: a1794390f1afc3631ac056e0f1677b7ab6f7ee74
refs/heads/master: 80778f18c09673df2712c7da28aa920469adcae2
34 changes: 26 additions & 8 deletions trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1906,24 +1906,42 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)
int r;
char *data = NULL;

if (!info->attrs[NL80211_ATTR_REG_ALPHA2])
return -EINVAL;
/*
* You should only get this when cfg80211 hasn't yet initialized
* completely when built-in to the kernel right between the time
* window between nl80211_init() and regulatory_init(), if that is
* even possible.
*/
mutex_lock(&cfg80211_mutex);
if (unlikely(!cfg80211_regdomain)) {
r = -EINPROGRESS;
goto out;
}

if (!info->attrs[NL80211_ATTR_REG_ALPHA2]) {
r = -EINVAL;
goto out;
}

data = nla_data(info->attrs[NL80211_ATTR_REG_ALPHA2]);

#ifdef CONFIG_WIRELESS_OLD_REGULATORY
/* We ignore world regdom requests with the old regdom setup */
if (is_world_regdom(data))
return -EINVAL;
if (is_world_regdom(data)) {
r = -EINVAL;
goto out;
}
#endif
mutex_lock(&cfg80211_mutex);
r = __regulatory_hint(NULL, REGDOM_SET_BY_USER, data, 0, ENVIRON_ANY);
mutex_unlock(&cfg80211_mutex);
/* This means the regulatory domain was already set, however
/*
* This means the regulatory domain was already set, however
* we don't want to confuse userspace with a "successful error"
* message so lets just treat it as a success */
* message so lets just treat it as a success
*/
if (r == -EALREADY)
r = 0;
out:
mutex_unlock(&cfg80211_mutex);
return r;
}

Expand Down

0 comments on commit af4a1a4

Please sign in to comment.