From 8b8faf52093843560c029759722e3f290aa57084 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 2 Jun 2022 23:42:40 +0200 Subject: [PATCH] wpa_supplicant: declare variables in header files as extern The definition of variables in header files lead to multiple defined symbols if these header files are included multiple times. Variables in header files are therefore declared as extern. --- .../esp_supplicant/include/esp_wpa.h | 4 +- components/wpa_supplicant/src/eap_peer/eap.h | 42 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/components/wpa_supplicant/esp_supplicant/include/esp_wpa.h b/components/wpa_supplicant/esp_supplicant/include/esp_wpa.h index f448b737..cdfd7abc 100644 --- a/components/wpa_supplicant/esp_supplicant/include/esp_wpa.h +++ b/components/wpa_supplicant/esp_supplicant/include/esp_wpa.h @@ -42,9 +42,9 @@ extern "C" { * @{ */ /* Crypto callback functions */ -const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; +extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; /* Mesh crypto callback functions */ -const mesh_crypto_funcs_t g_wifi_default_mesh_crypto_funcs; +extern const mesh_crypto_funcs_t g_wifi_default_mesh_crypto_funcs; /** * @brief Supplicant initialization diff --git a/components/wpa_supplicant/src/eap_peer/eap.h b/components/wpa_supplicant/src/eap_peer/eap.h index f787e35d..90d1f845 100644 --- a/components/wpa_supplicant/src/eap_peer/eap.h +++ b/components/wpa_supplicant/src/eap_peer/eap.h @@ -19,33 +19,33 @@ struct eap_method_type { EapType method; }; -u8 *g_wpa_anonymous_identity; -int g_wpa_anonymous_identity_len; -u8 *g_wpa_username; -int g_wpa_username_len; -const u8 *g_wpa_client_cert; -int g_wpa_client_cert_len; -const u8 *g_wpa_private_key; -int g_wpa_private_key_len; -const u8 *g_wpa_private_key_passwd; -int g_wpa_private_key_passwd_len; +extern u8 *g_wpa_anonymous_identity; +extern int g_wpa_anonymous_identity_len; +extern u8 *g_wpa_username; +extern int g_wpa_username_len; +extern const u8 *g_wpa_client_cert; +extern int g_wpa_client_cert_len; +extern const u8 *g_wpa_private_key; +extern int g_wpa_private_key_len; +extern const u8 *g_wpa_private_key_passwd; +extern int g_wpa_private_key_passwd_len; -const u8 *g_wpa_ca_cert; -int g_wpa_ca_cert_len; +extern const u8 *g_wpa_ca_cert; +extern int g_wpa_ca_cert_len; -u8 *g_wpa_password; -int g_wpa_password_len; +extern u8 *g_wpa_password; +extern int g_wpa_password_len; -u8 *g_wpa_new_password; -int g_wpa_new_password_len; +extern u8 *g_wpa_new_password; +extern int g_wpa_new_password_len; -char *g_wpa_ttls_phase2_type; -char *g_wpa_phase1_options; +extern char *g_wpa_ttls_phase2_type; +extern char *g_wpa_phase1_options; -u8 *g_wpa_pac_file; -int g_wpa_pac_file_len; +extern u8 *g_wpa_pac_file; +extern int g_wpa_pac_file_len; -bool g_wpa_suiteb_certification; +extern bool g_wpa_suiteb_certification; const u8 * eap_get_eapKeyData(struct eap_sm *sm, size_t *len); void eap_deinit_prev_method(struct eap_sm *sm, const char *txt); -- 2.34.1