Patchwork [09/15] rsn: Add debug code for pmksa cache.

login
register
mail settings
Submitter Ben Greear
Date March 6, 2014, 12:19 a.m.
Message ID <1394065200-20377-9-git-send-email-greearb@candelatech.com>
Download mbox | patch
Permalink /patch/327245/
State New
Headers show

Comments

Ben Greear - March 6, 2014, 12:19 a.m.
From: Ben Greear <greearb@candelatech.com>

Dodgy radius server was causing failures.  This code was added
to debug the problem, but was never used as user figured out RADIUS
problem first.

Signed-hostap: Ben Greear <greearb@candelatech.com>
---
 src/rsn_supp/pmksa_cache.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

Patch

diff --git a/src/rsn_supp/pmksa_cache.c b/src/rsn_supp/pmksa_cache.c
index 0960815..fbf0f96 100644
--- a/src/rsn_supp/pmksa_cache.c
+++ b/src/rsn_supp/pmksa_cache.c
@@ -321,6 +321,28 @@  struct rsn_pmksa_cache_entry * pmksa_cache_get(struct rsn_pmksa_cache *pmksa,
 			return entry;
 		entry = entry->next;
 	}
+
+#if 0
+	/* Verbose debugging, we failed to find the cache entry, so print out
+	 * everything to figure out why.
+	 */
+	wpa_printf(MSG_DEBUG, "RSN: pmksa-cache-get failed lookup, network-ctx: %p",
+		   network_ctx);
+	if (aa)
+		wpa_printf(MSG_DEBUG, "RSN: aa: " MACSTR "", MAC2STR(aa));
+	if (pmkid)
+		wpa_hexdump(MSG_DEBUG, "RSN: pmkid",
+			    pmkid, PMKID_LEN);
+	entry = pmksa->pmksa;
+	while (entry) {
+		wpa_printf(MSG_DEBUG, "RSN: entry: %p  aa: " MACSTR
+			   " network-ctx: %p",
+			   MAC2STR(entry->aa), entry->network_ctx);
+		wpa_hexdump(MSG_DEBUG, "RSN: pmkid",
+			    entry->pmkid, PMKID_LEN);
+		entry = entry->next;
+	}
+#endif
 	return NULL;
 }