All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2 v2 BlueZ] mesh: Add provisioning algorithms config
@ 2024-08-28  8:32 Junho Lee
  2024-08-28 10:33 ` [1/2,v2,BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Junho Lee @ 2024-08-28  8:32 UTC (permalink / raw)
  To: linux-bluetooth

This added the Algorithms config to the conf file because there was a
`TODO` comment waiting to be added to the config file, and it was a
mutable config.

Signed-off-by: Junho Lee <tot0roprog@gmail.com>
---

v2: Split commits because the previous commit appears to have changed two issues
at once

 mesh/mesh-main.conf | 5 +++++
 mesh/mesh.c         | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/mesh/mesh-main.conf b/mesh/mesh-main.conf
index aca9e6fa5..72154493e 100644
--- a/mesh/mesh-main.conf
+++ b/mesh/mesh-main.conf
@@ -41,3 +41,8 @@
 # Setting this value to zero means there's no timeout.
 # Defaults to 60.
 #ProvTimeout = 60
+
+# Bitmask of supported provisioning security algorithms.
+# Valid range: 0-65535
+# Defaults to 1.
+#Algorithms = 1
diff --git a/mesh/mesh.c b/mesh/mesh.c
index 91cf25175..7b670e40a 100644
--- a/mesh/mesh.c
+++ b/mesh/mesh.c
@@ -245,6 +245,10 @@ static void parse_settings(const char *mesh_conf_fname)
 	if (l_settings_get_uint(settings, "General", "ProvTimeout", &value))
 		mesh.prov_timeout = value;
 
+	if (l_settings_get_uint(settings, "General", "Algorithms", &value) &&
+								value <= 65535)
+		mesh.algorithms = value;
+
 done:
 	l_settings_free(settings);
 }
@@ -262,7 +266,6 @@ bool mesh_init(const char *config_dir, const char *mesh_conf_fname,
 	mesh_model_init();
 	mesh_agent_init();
 
-	/* TODO: read mesh.conf */
 	mesh.prov_timeout = DEFAULT_PROV_TIMEOUT;
 	mesh.algorithms = DEFAULT_ALGORITHMS;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-28 10:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28  8:32 [PATCH 1/2 v2 BlueZ] mesh: Add provisioning algorithms config Junho Lee
2024-08-28 10:33 ` [1/2,v2,BlueZ] " bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.