aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/wext.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-02-10 15:25:40 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-13 13:45:24 -0500
commite4e5e2b0b83c816e581ca4671569306bcba77667 (patch)
tree5593639864683f2f937f9f9639d3e5181daeb92f /net/mac80211/wext.c
parenta4727801004f255f589478b2d75ec00f0a9e30c5 (diff)
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: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/wext.c')
-rw-r--r--net/mac80211/wext.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index bad1cfbfdf18..acd5808b87f4 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -982,9 +982,21 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev,
982 break; 982 break;
983 } 983 }
984 if (sdata->vif.type == NL80211_IFTYPE_STATION || 984 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
985 sdata->vif.type == NL80211_IFTYPE_ADHOC) 985 sdata->vif.type == NL80211_IFTYPE_ADHOC) {
986 sdata->u.sta.mfp = data->value; 986 switch (data->value) {
987 else 987 case IW_AUTH_MFP_DISABLED:
988 sdata->u.sta.mfp = IEEE80211_MFP_DISABLED;
989 break;
990 case IW_AUTH_MFP_OPTIONAL:
991 sdata->u.sta.mfp = IEEE80211_MFP_OPTIONAL;
992 break;
993 case IW_AUTH_MFP_REQUIRED:
994 sdata->u.sta.mfp = IEEE80211_MFP_REQUIRED;
995 break;
996 default:
997 ret = -EINVAL;
998 }
999 } else
988 ret = -EOPNOTSUPP; 1000 ret = -EOPNOTSUPP;
989 break; 1001 break;
990 default: 1002 default: