提交 3383b5a6 编写于 作者: J Johannes Berg 提交者: John W. Linville

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: NJohannes Berg <johannes.berg@intel.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 bdbc59b3
......@@ -1594,6 +1594,8 @@ enum nl80211_sta_flags {
NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
};
#define NL80211_STA_FLAG_MAX_OLD_API NL80211_STA_FLAG_TDLS_PEER
/**
* struct nl80211_sta_flag_update - station flags mask/set
* @mask: mask of station flags to set
......
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册