00ee6d
From 5b093570dca1855c5bf40bcbd8d149fa6f8ea8ff Mon Sep 17 00:00:00 2001
00ee6d
Message-Id: <5b093570dca1855c5bf40bcbd8d149fa6f8ea8ff.1650620058.git.davide.caratti@gmail.com>
00ee6d
From: Lubomir Rintel <lkundrak@v3.sk>
00ee6d
Date: Mon, 7 Mar 2022 09:54:46 +0100
00ee6d
Subject: [PATCH] D-Bus: Add 'wep_disabled' capability
00ee6d
00ee6d
Since commit 200c7693c9a1 ('Make WEP functionality an optional build
00ee6d
parameter'), WEP support is optional and, indeed, off by default.
00ee6d
00ee6d
The distributions are now catching up and disabling WEP in their builds.
00ee6d
Unfortunately, there's no indication prior to an attempt to connect to a
00ee6d
WEP network that it's not going to work. Add a capability to communicate
00ee6d
that.
00ee6d
00ee6d
Unlike other capabilities, this one is negative. That is, it indicates
00ee6d
lack of a WEP support as opposed to its presence. This is necessary
00ee6d
because historically there has been no capability to indicate presence
00ee6d
of WEP support and therefore NetworkManager (and probably others) just
00ee6d
assumes it's there.
00ee6d
00ee6d
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
00ee6d
Acked-by: Davide Caratti <davide.caratti@gmail.com>
00ee6d
---
00ee6d
 wpa_supplicant/dbus/dbus_new_handlers.c | 5 ++++-
00ee6d
 1 file changed, 4 insertions(+), 1 deletion(-)
00ee6d
00ee6d
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
00ee6d
index 1c9ded09a..0b1002bf1 100644
00ee6d
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
00ee6d
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
00ee6d
@@ -1121,7 +1121,7 @@ dbus_bool_t wpas_dbus_getter_global_capabilities(
00ee6d
 	const struct wpa_dbus_property_desc *property_desc,
00ee6d
 	DBusMessageIter *iter, DBusError *error, void *user_data)
00ee6d
 {
00ee6d
-	const char *capabilities[13];
00ee6d
+	const char *capabilities[14];
00ee6d
 	size_t num_items = 0;
00ee6d
 	struct wpa_global *global = user_data;
00ee6d
 	struct wpa_supplicant *wpa_s;
00ee6d
@@ -1177,6 +1177,9 @@ dbus_bool_t wpas_dbus_getter_global_capabilities(
00ee6d
 #endif /* CONFIG_SUITEB192 */
00ee6d
 	if (ext_key_id_supported)
00ee6d
 		capabilities[num_items++] = "extended_key_id";
00ee6d
+#ifndef CONFIG_WEP
00ee6d
+	capabilities[num_items++] = "wep_disabled";
00ee6d
+#endif /* !CONFIG_WEP */
00ee6d
 
00ee6d
 	return wpas_dbus_simple_array_property_getter(iter,
00ee6d
 						      DBUS_TYPE_STRING,
00ee6d
-- 
00ee6d
2.35.1
00ee6d