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) &&
        |                                           ^~

Add ifdef statements around the calling function to fix the issue.

Signed-off-by: Nick Hainke <vincent@systemli.org>
This commit is contained in:
Nick Hainke 2023-03-14 22:17:19 +01:00 committed by Jouni Malinen
parent c62e94d793
commit f45cf609c7

View file

@ -1835,6 +1835,7 @@ int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
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)) {
@ -1857,6 +1858,7 @@ int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
#endif /* CONFIG_WPS */
return -1;
}
#endif /* IEEE8021X_EAPOL */
wpa_msg(wpa_s, MSG_DEBUG,
"Considering connect request: reassociate: %d selected: "