Patchwork [PATCHv2] ctrl_iface: check for IEEE8021X_EAPOL definition in wpa_supplicant_ctrl_iface_ctrl_rsp_handle()

login
register
mail settings
Submitter Antonio Quartulli
Date Dec. 12, 2011, 5:23 p.m.
Message ID <1323710628-12208-1-git-send-email-ordex@autistici.org>
Download mbox | patch
Permalink /patch/130803/
State Accepted
Commit b58bcbb2efdaf3f777010f27234b333cfc8f1f00
Headers show

Comments

Antonio Quartulli - Dec. 12, 2011, 5:23 p.m.
The whole wpa_supplicant_ctrl_iface_ctrl_rsp_handle() function operates on the
ssid->eap field which exists only if IEEE8021X_EAPOL has been defined. Therefore
the whole function body needs to be enclosed within an #ifdef/endif block.

Signed-hostap: Antonio Quartulli <ordex@autistici.org>
---

Sign line modified

 wpa_supplicant/ctrl_iface.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
Jouni Malinen - Dec. 17, 2011, 4:06 p.m.
On Mon, Dec 12, 2011 at 06:23:48PM +0100, Antonio Quartulli wrote:
> The whole wpa_supplicant_ctrl_iface_ctrl_rsp_handle() function operates on the
> ssid->eap field which exists only if IEEE8021X_EAPOL has been defined. Therefore
> the whole function body needs to be enclosed within an #ifdef/endif block.

Thanks, applied.

Patch

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index b9ec347..29d507b 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -769,6 +769,7 @@  int wpa_supplicant_ctrl_iface_ctrl_rsp_handle(struct wpa_supplicant *wpa_s,
 					      const char *field,
 					      const char *value)
 {
+#ifdef IEEE8021X_EAPOL
 	struct eap_peer_config *eap = &ssid->eap;
 
 	wpa_printf(MSG_DEBUG, "CTRL_IFACE: response handle field=%s", field);
@@ -828,6 +829,11 @@  int wpa_supplicant_ctrl_iface_ctrl_rsp_handle(struct wpa_supplicant *wpa_s,
 	}
 
 	return 0;
+
+#else /* IEEE8021X_EAPOL */
+	wpa_printf(MSG_DEBUG, "CTRL_IFACE: 802.1X not included");
+	return -1;
+#endif /* IEEE8021X_EAPOL */
 }