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

mac80211: properly validate/translate IW_AUTH_MFP values

Make sure nobody passes in bogus values, and translate the values
(although it isn't necessary).
Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 a4727801
......@@ -982,9 +982,21 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev,
break;
}
if (sdata->vif.type == NL80211_IFTYPE_STATION ||
sdata->vif.type == NL80211_IFTYPE_ADHOC)
sdata->u.sta.mfp = data->value;
else
sdata->vif.type == NL80211_IFTYPE_ADHOC) {
switch (data->value) {
case IW_AUTH_MFP_DISABLED:
sdata->u.sta.mfp = IEEE80211_MFP_DISABLED;
break;
case IW_AUTH_MFP_OPTIONAL:
sdata->u.sta.mfp = IEEE80211_MFP_OPTIONAL;
break;
case IW_AUTH_MFP_REQUIRED:
sdata->u.sta.mfp = IEEE80211_MFP_REQUIRED;
break;
default:
ret = -EINVAL;
}
} else
ret = -EOPNOTSUPP;
break;
default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册