[PATCH] Fix: Compiler warning on disabled PMKSA_CACHE_EXTERNAL
Koen Vandeputte
koen.vandeputte at ncentric.com
Wed Dec 14 02:06:55 PST 2016
Fixes a compiler warning when CONFIG_PMKSA_CACHE_EXTERNAL and
CONFIG_IEEE8021X_EAPOL are disabled.
All functions calling these 2 and it's own dependencies
are embraced by one of these macro's, resulting in the warning when
disabled.
../src/rsn_supp/wpa.c: In function 'wpa_sm_pmksa_cache_head':
../src/rsn_supp/wpa.c:3036:9: warning: implicit declaration of function
'pmksa_cache_head' [-Wimplicit-function-declaration]
return pmksa_cache_head(sm->pmksa);
^~~~~~~~~~~~~~~~
../src/rsn_supp/wpa.c:3036:9: warning: return makes pointer from integer
without a cast [-Wint-conversion]
return pmksa_cache_head(sm->pmksa);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/rsn_supp/wpa.c: In function 'wpa_sm_pmksa_cache_add_entry':
../src/rsn_supp/wpa.c:3044:9: warning: implicit declaration of function
'pmksa_cache_add_entry' [-Wimplicit-function-declaration]
return pmksa_cache_add_entry(sm->pmksa, entry);
^~~~~~~~~~~~~~~~~~~~~
../src/rsn_supp/wpa.c:3044:9: warning: return makes pointer from integer
without a cast [-Wint-conversion]
return pmksa_cache_add_entry(sm->pmksa, entry);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
src/rsn_supp/wpa.c | 3 ++-
src/rsn_supp/wpa.h | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index 8093634..e89d70a 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -3027,7 +3027,7 @@ int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len)
return pmksa_cache_list(sm->pmksa, buf, len);
}
-
+#ifdef CONFIG_PMKSA_CACHE_EXTERNAL
struct rsn_pmksa_cache_entry * wpa_sm_pmksa_cache_head(struct wpa_sm *sm)
{
return pmksa_cache_head(sm->pmksa);
@@ -3041,6 +3041,7 @@ wpa_sm_pmksa_cache_add_entry(struct wpa_sm *sm,
return pmksa_cache_add_entry(sm->pmksa, entry);
}
+#endif /* CONFIG_PMKSA_CACHE_EXTERNAL */
void wpa_sm_drop_sa(struct wpa_sm *sm)
{
diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h
index d1a810b..ecfb7cf 100644
--- a/src/rsn_supp/wpa.h
+++ b/src/rsn_supp/wpa.h
@@ -149,10 +149,14 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr,
const u8 *buf, size_t len);
int wpa_sm_parse_own_wpa_ie(struct wpa_sm *sm, struct wpa_ie_data *data);
int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len);
+
+#ifdef CONFIG_PMKSA_CACHE_EXTERNAL
struct rsn_pmksa_cache_entry * wpa_sm_pmksa_cache_head(struct wpa_sm *sm);
struct rsn_pmksa_cache_entry *
wpa_sm_pmksa_cache_add_entry(struct wpa_sm *sm,
struct rsn_pmksa_cache_entry * entry);
+#endif /*CONFIG_PMKSA_CACHE_EXTERNAL */
+
void wpa_sm_drop_sa(struct wpa_sm *sm);
int wpa_sm_has_ptk(struct wpa_sm *sm);
--
2.7.4
More information about the Hostap
mailing list