]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Print NL80211_CMD_{SET,DEL}_PMKSA failures in debug log
authorJouni Malinen <jouni@codeaurora.org>
Sat, 10 Feb 2018 10:10:07 +0000 (12:10 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 10 Feb 2018 10:10:07 +0000 (12:10 +0200)
This makes it easier to notice if the driver operation to manage PMKSA
cache information fails unexpectedly.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/drivers/driver_nl80211.c

index dc453ab2771c24f0597b1cfd9397c0072d23e63f..d01a0e18f46a9502e47aeca6d983234d07325e96 100644 (file)
@@ -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;
 }