From 799bca07ef7d693f533e4c9cc6fe34a3acc5b0b1 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Mon, 18 May 2009 19:56:36 +0200 Subject: [PATCH] --- yaml --- r: 150403 b: refs/heads/master c: e3da574a0ddd3e90a1e2b788b84b94bc17a75172 h: refs/heads/master i: 150401: 76b039948850870936d37024efc3bf82694de169 150399: 18e263d76f50c650b5ec5b3c8cb1233f6a730a4e v: v3 --- [refs] | 2 +- trunk/include/net/cfg80211.h | 5 +++-- trunk/net/wireless/wext-compat.c | 7 +++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index d17ef35e9ec6..7c12ca58aac3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 73606d00360cb93963aeb7bfbf8bfdbc51cfab9f +refs/heads/master: e3da574a0ddd3e90a1e2b788b84b94bc17a75172 diff --git a/trunk/include/net/cfg80211.h b/trunk/include/net/cfg80211.h index 81a3bfa45471..389f1d20adf4 100644 --- a/trunk/include/net/cfg80211.h +++ b/trunk/include/net/cfg80211.h @@ -781,10 +781,11 @@ enum wiphy_params_flags { * @get_key: get information about the key with the given parameters. * @mac_addr will be %NULL when requesting information for a group * key. All pointers given to the @callback function need not be valid - * after it returns. + * after it returns. This function should return an error if it is + * not possible to retrieve the key, -ENOENT if it doesn't exist. * * @del_key: remove a key given the @mac_addr (%NULL for a group key) - * and @key_index + * and @key_index, return -ENOENT if the key doesn't exist. * * @set_default_key: set the default key on an interface * diff --git a/trunk/net/wireless/wext-compat.c b/trunk/net/wireless/wext-compat.c index f98090b90fbf..711e00a0c9b5 100644 --- a/trunk/net/wireless/wext-compat.c +++ b/trunk/net/wireless/wext-compat.c @@ -504,6 +504,13 @@ static int cfg80211_set_encryption(struct cfg80211_registered_device *rdev, else if (idx == wdev->wext.default_mgmt_key) wdev->wext.default_mgmt_key = -1; } + /* + * Applications using wireless extensions expect to be + * able to delete keys that don't exist, so allow that. + */ + if (err == -ENOENT) + return 0; + return err; } else { if (addr)