aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/hostapd/patches/170-wpa_supplicant-fix-compiling-without-IEEE8021X_EAPOL.patch
blob: 7724f1ae8d649638f91bc3da049bb5d035bb61f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From c85ce84d942e1eabde33e120b18e5b1f1637b76e Mon Sep 17 00:00:00 2001
From: Nick Hainke <vincent@systemli.org>
Date: Tue, 14 Mar 2023 21:40:53 +0100
Subject: [PATCH] wpa_supplicant: fix compiling without IEEE8021X_EAPOL

If IEEE8021X_EAPOL is not defined wpa_supplicant will not compile with
following error:

  events.c: In function 'wpa_supplicant_connect':
  events.c:1827:14: warning: implicit declaration of function 'eap_is_wps_pbc_enrollee' [-Wimplicit-function-declaration]
   1827 |         if ((eap_is_wps_pbc_enrollee(&ssid->eap) &&
        |              ^~~~~~~~~~~~~~~~~~~~~~~
  events.c:1827:43: error: 'struct wpa_ssid' has no member named 'eap'
   1827 |         if ((eap_is_wps_pbc_enrollee(&ssid->eap) &&
        |                                           ^~

Adding ifdef statements around the calling function fixes the issue.

Signed-off-by: Nick Hainke <vincent@systemli.org>
---
 wpa_supplicant/events.c | 2 ++
 1 file changed, 2 insertions(+)

--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1824,6 +1824,7 @@ int wpa_supplicant_connect(struct wpa_su
 			   struct wpa_bss *selected,
 			   struct wpa_ssid *ssid)
 {
+#ifdef IEEE8021X_EAPOL
 	if ((eap_is_wps_pbc_enrollee(&ssid->eap) &&
 	     wpas_wps_partner_link_overlap_detect(wpa_s)) ||
 	    wpas_wps_scan_pbc_overlap(wpa_s, selected, ssid)) {
@@ -1846,6 +1847,7 @@ int wpa_supplicant_connect(struct wpa_su
 #endif /* CONFIG_WPS */
 		return -1;
 	}
+#endif /* IEEE8021X_EAPOL */
 
 	wpa_msg(wpa_s, MSG_DEBUG,
 		"Considering connect request: reassociate: %d  selected: "