[PATCH] EAP: Fix Get EapMethods via dbus when IEEE8021X_EAPOL is disabled
Jonah Petri
jonah at sense.com
Tue Aug 25 08:16:36 PDT 2026
When IEEE8021X_EAPOL is disabled, wpa_supplicant would return "no
memory" when Get EapMethods or simply GetAll was issued via dbus. This
change fixes the stub code which is invoked when IEEE8021X_EAPOL is
disabled to match the return convention of its fully-fledged peer.
To test this, configure wpa_supplicant with IEEE8021X_EAPOL off, and
then issue something like:
busctl --system call fi.w1.wpa_supplicant1 /fi/w1/wpa_supplicant1 \
org.freedesktop.DBus.Properties GetAll s fi.w1.wpa_supplicant1
This patch fixes this issue by changing the behavior of wpa_supplicant
to return an empty array instead.
The "no memory" error was causing connman to not see the wifi interface
at all, as connman would treat the "no memory" error as cause to reject
the wifi interface.
Signed-off-by: Jonah Petri <jonah at sense.com>
---
src/eap_peer/eap_methods.h | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/eap_peer/eap_methods.h b/src/eap_peer/eap_methods.h
index e94f3d75a..6a5b39d4b 100644
--- a/src/eap_peer/eap_methods.h
+++ b/src/eap_peer/eap_methods.h
@@ -56,9 +56,19 @@ static inline void eap_peer_unregister_methods(void)
{
}
+/**
+ * This stub must match the return convention of the full function of the
+ * same name, which is enabled when CONFIG_IEEE8021X_EAPOL is enabled.
+ *
+ * Returns: A %NULL-terminated array of zero strings in this implementation,
+ * as IEEE8021X_EAPOL is disabled.
+ */
static inline char ** eap_get_names_as_string_array(size_t *num)
{
- return NULL;
+ char **result = calloc(1, sizeof(*result));
+ if (num)
+ *num = 0;
+ return result;
}
#endif /* IEEE8021X_EAPOL */
--
2.43.0
More information about the Hostap
mailing list