return -EFAULT;
buf[len] = '\0';
- if (kstrtoul(buf, 0, &disable_ani))
- if (strict_strtoul(buf, 0, &ani))
++ if (kstrtoul(buf, 0, &ani))
return -EINVAL;
- common->disable_ani = !!disable_ani;
+ if (ani < 0 || ani > 1)
+ return -EINVAL;
+
+ common->disable_ani = !ani;
- if (disable_ani) {
+ if (common->disable_ani) {
clear_bit(SC_OP_ANI_RUN, &sc->sc_flags);
ath_stop_ani(sc);
} else {
return 0;
}
- static int ieee80211_verify_mac(struct ieee80211_sub_if_data *sdata, u8 *addr)
-static int ieee80211_verify_mac(struct ieee80211_local *local, u8 *addr,
++static int ieee80211_verify_mac(struct ieee80211_sub_if_data *sdata, u8 *addr,
+ bool check_dup)
{
- struct ieee80211_sub_if_data *sdata;
+ struct ieee80211_local *local = sdata->local;
+ struct ieee80211_sub_if_data *iter;
u64 new, mask, tmp;
u8 *m;
int ret = 0;
((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) |
((u64)m[4] << 1*8) | ((u64)m[5] << 0*8);
+ if (!check_dup)
+ return ret;
mutex_lock(&local->iflist_mtx);
- list_for_each_entry(sdata, &local->interfaces, list) {
- if (sdata->vif.type == NL80211_IFTYPE_MONITOR &&
- !(sdata->u.mntr_flags & MONITOR_FLAG_ACTIVE))
+ list_for_each_entry(iter, &local->interfaces, list) {
+ if (iter == sdata)
continue;
- if (iter->vif.type == NL80211_IFTYPE_MONITOR)
- m = sdata->vif.addr;
++ if (iter->vif.type == NL80211_IFTYPE_MONITOR &&
++ !(iter->u.mntr_flags & MONITOR_FLAG_ACTIVE))
+ continue;
+
+ m = iter->vif.addr;
tmp = ((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) |
((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) |
((u64)m[4] << 1*8) | ((u64)m[5] << 0*8);
if (ieee80211_sdata_running(sdata))
return -EBUSY;
- ret = ieee80211_verify_mac(sdata, sa->sa_data);
+ if (sdata->vif.type == NL80211_IFTYPE_MONITOR &&
+ !(sdata->u.mntr_flags & MONITOR_FLAG_ACTIVE))
+ check_dup = false;
+
- ret = ieee80211_verify_mac(sdata->local, sa->sa_data, check_dup);
++ ret = ieee80211_verify_mac(sdata, sa->sa_data, check_dup);
if (ret)
return ret;