From: Jouni Malinen Date: Sat, 10 Feb 2018 10:10:07 +0000 (+0200) Subject: nl80211: Print NL80211_CMD_{SET,DEL}_PMKSA failures in debug log X-Git-Tag: hostap_2_7~577 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7f6e6ee1ba3c700c379f11b1d63d62ec6f1c430;p=thirdparty%2Fhostap.git nl80211: Print NL80211_CMD_{SET,DEL}_PMKSA failures in debug log This makes it easier to notice if the driver operation to manage PMKSA cache information fails unexpectedly. Signed-off-by: Jouni Malinen --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index dc453ab27..d01a0e18f 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -7639,6 +7639,7 @@ static int nl80211_pmkid(struct i802_bss *bss, int cmd, static int nl80211_add_pmkid(void *priv, struct wpa_pmkid_params *params) { struct i802_bss *bss = priv; + int ret; if (params->bssid) wpa_printf(MSG_DEBUG, "nl80211: Add PMKID for " MACSTR, @@ -7650,13 +7651,21 @@ static int nl80211_add_pmkid(void *priv, struct wpa_pmkid_params *params) wpa_ssid_txt(params->ssid, params->ssid_len)); } - return nl80211_pmkid(bss, NL80211_CMD_SET_PMKSA, params); + ret = nl80211_pmkid(bss, NL80211_CMD_SET_PMKSA, params); + if (ret < 0) { + wpa_printf(MSG_DEBUG, + "nl80211: NL80211_CMD_SET_PMKSA failed: %d (%s)", + ret, strerror(-ret)); + } + + return ret; } static int nl80211_remove_pmkid(void *priv, struct wpa_pmkid_params *params) { struct i802_bss *bss = priv; + int ret; if (params->bssid) wpa_printf(MSG_DEBUG, "nl80211: Delete PMKID for " MACSTR, @@ -7668,7 +7677,14 @@ static int nl80211_remove_pmkid(void *priv, struct wpa_pmkid_params *params) wpa_ssid_txt(params->ssid, params->ssid_len)); } - return nl80211_pmkid(bss, NL80211_CMD_DEL_PMKSA, params); + ret = nl80211_pmkid(bss, NL80211_CMD_DEL_PMKSA, params); + if (ret < 0) { + wpa_printf(MSG_DEBUG, + "nl80211: NL80211_CMD_DEL_PMKSA failed: %d (%s)", + ret, strerror(-ret)); + } + + return ret; }