[PATCH 2/2] Fix build without CONFIG_NO_CONFIG_WRITE enabled.

Solomon Peachy pizza
Mon Mar 11 14:34:58 PDT 2013


Signed-off-by: Solomon Peachy <pizza at shaftnet.org>
---
 wpa_supplicant/config.c    | 10 +++++-----
 wpa_supplicant/wpas_glue.c |  6 ++++++
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 6860765..cec2516 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -1021,6 +1021,7 @@ static int wpa_config_parse_eap(const struct parse_data *data,
 }
 
 
+#ifndef NO_CONFIG_WRITE
 static char * wpa_config_write_eap(const struct parse_data *data,
 				   struct wpa_ssid *ssid)
 {
@@ -1054,7 +1055,7 @@ static char * wpa_config_write_eap(const struct parse_data *data,
 
 	return buf;
 }
-
+#endif /* NO_CONFIG_WRITE */
 
 static int wpa_config_parse_password(const struct parse_data *data,
 				     struct wpa_ssid *ssid, int line,
@@ -1135,7 +1136,7 @@ static int wpa_config_parse_password(const struct parse_data *data,
 	return 0;
 }
 
-
+#ifndef NO_CONFIG_WRITE
 static char * wpa_config_write_password(const struct parse_data *data,
 					struct wpa_ssid *ssid)
 {
@@ -1169,6 +1170,7 @@ static char * wpa_config_write_password(const struct parse_data *data,
 
 	return buf;
 }
+#endif /* NO_CONFIG_WRITE */
 #endif /* IEEE8021X_EAPOL */
 
 
@@ -2067,7 +2069,7 @@ int wpa_config_set_quoted(struct wpa_ssid *ssid, const char *var,
 	return ret;
 }
 
-
+#ifndef NO_CONFIG_WRITE
 /**
  * wpa_config_get_all - Get all options from network configuration
  * @ssid: Pointer to network configuration data
@@ -2129,8 +2131,6 @@ err:
 	return NULL;
 }
 
-
-#ifndef NO_CONFIG_WRITE
 /**
  * wpa_config_get - Get a variable in network configuration
  * @ssid: Pointer to network configuration data
diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
index 7585b86..0a931d6 100644
--- a/wpa_supplicant/wpas_glue.c
+++ b/wpa_supplicant/wpas_glue.c
@@ -35,6 +35,7 @@ static void wpa_supplicant_set_config_blob(void *ctx,
 {
 	struct wpa_supplicant *wpa_s = ctx;
 	wpa_config_set_blob(wpa_s->conf, blob);
+#ifndef CONFIG_NO_CONFIG_WRITE
 	if (wpa_s->conf->update_config) {
 		int ret = wpa_config_write(wpa_s->confname, wpa_s->conf);
 		if (ret) {
@@ -42,6 +43,7 @@ static void wpa_supplicant_set_config_blob(void *ctx,
 				   "blob set");
 		}
 	}
+#endif /* CONFIG_NO_CONFIG_WRITE */
 }
 
 
@@ -770,6 +772,7 @@ static void wpa_supplicant_set_anon_id(void *ctx, const u8 *id, size_t len)
 			return;
 	}
 
+#ifndef CONFIG_NO_CONFIG_WRITE
 	if (wpa_s->conf->update_config) {
 		res = wpa_config_write(wpa_s->confname, wpa_s->conf);
 		if (res) {
@@ -777,6 +780,7 @@ static void wpa_supplicant_set_anon_id(void *ctx, const u8 *id, size_t len)
 				   "anonymous_id update");
 		}
 	}
+#endif /* CONFIG_NO_CONFIG_WRITE */
 }
 #endif /* IEEE8021X_EAPOL */
 
@@ -798,8 +802,10 @@ int wpa_supplicant_init_eapol(struct wpa_supplicant *wpa_s)
 	ctx->eapol_done_cb = wpa_supplicant_notify_eapol_done;
 	ctx->eapol_send = wpa_supplicant_eapol_send;
 	ctx->set_wep_key = wpa_eapol_set_wep_key;
+#ifndef CONFIG_NO_CONFIG_BLOBS
 	ctx->set_config_blob = wpa_supplicant_set_config_blob;
 	ctx->get_config_blob = wpa_supplicant_get_config_blob;
+#endif /* CONFIG_NO_CONFIG_BLOBS */
 	ctx->aborted_cached = wpa_supplicant_aborted_cached;
 	ctx->opensc_engine_path = wpa_s->conf->opensc_engine_path;
 	ctx->pkcs11_engine_path = wpa_s->conf->pkcs11_engine_path;
-- 
1.7.11.7




More information about the Hostap mailing list