aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/wext-compat.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-05-18 13:56:36 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-20 14:46:30 -0400
commite3da574a0ddd3e90a1e2b788b84b94bc17a75172 (patch)
treedc17ed9268594c1236e1f0b5efae2140b226b5cf /net/wireless/wext-compat.c
parent73606d00360cb93963aeb7bfbf8bfdbc51cfab9f (diff)
cfg80211: allow wext to remove keys that don't exist
Some applications using wireless extensions expect to be able to remove a key that doesn't exist. One example is wpa_supplicant which doesn't actually change behaviour when running into an error while trying to do that, but it prints an error message which users interpret as wpa_supplicant having problems. The safe thing to do is not change the behaviour of wireless extensions any more, so when the driver reports -ENOENT let the wext bridge code return success to userspace. To guarantee this, also document that drivers should return -ENOENT when the key doesn't exist. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/wext-compat.c')
-rw-r--r--net/wireless/wext-compat.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index f98090b90fbf..711e00a0c9b5 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -504,6 +504,13 @@ static int cfg80211_set_encryption(struct cfg80211_registered_device *rdev,
504 else if (idx == wdev->wext.default_mgmt_key) 504 else if (idx == wdev->wext.default_mgmt_key)
505 wdev->wext.default_mgmt_key = -1; 505 wdev->wext.default_mgmt_key = -1;
506 } 506 }
507 /*
508 * Applications using wireless extensions expect to be
509 * able to delete keys that don't exist, so allow that.
510 */
511 if (err == -ENOENT)
512 return 0;
513
507 return err; 514 return err;
508 } else { 515 } else {
509 if (addr) 516 if (addr)