Skip to content

Commit

Permalink
mac80211: properly validate/translate IW_AUTH_MFP values
Browse files Browse the repository at this point in the history
Make sure nobody passes in bogus values, and translate the values
(although it isn't necessary).

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Feb 13, 2009
1 parent a472780 commit e4e5e2b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions net/mac80211/wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e4e5e2b

Please sign in to comment.