nl80211: prevent additions to old station flags API

We don't really want/need to maintain the old
station flags API any more, so refuse changes
to new (not yet defined) flags from the old
flags API.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
This commit is contained in:
Johannes Berg 2012-05-10 20:14:43 +02:00 • committed by John W. Linville
commit 3383b5a69d
2 changed files with 10 additions and 2 deletions

View file

@ -2410,10 +2410,16 @@ static int parse_station_flags(struct genl_info *info,
return -EINVAL;
}
for (flag = 1; flag <= NL80211_STA_FLAG_MAX; flag++)
if (flags[flag])
for (flag = 1; flag <= NL80211_STA_FLAG_MAX; flag++) {
if (flags[flag]) {
params->sta_flags_set |= (1<<flag);
/* no longer support new API additions in old API */
if (flag > NL80211_STA_FLAG_MAX_OLD_API)
return -EINVAL;
}
}
return 0;
}