[PATCH v3 BlueZ 4/4] src: rename MinEncKeySize

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/main.c    | 16 +++++++++++++---
 src/main.conf |  4 ++--
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/main.c b/src/main.c
index b70e6044b..060c2cc33 100644
--- a/src/main.c
+++ b/src/main.c
@@ -104,7 +104,8 @@ static const char *policy_options[] = {
 
 static const char *gatt_options[] = {
 	"Cache",
-	"MinEncKeySize",
+	"MinEncKeySize", /* deprecated */
+	"MinEncryptionKeySize",
 	"DefaultLeMtu",
 	NULL
 };
@@ -411,12 +412,21 @@ static void parse_config(GKeyFile *config)
 	}
 
 	val = g_key_file_get_integer(config, "GATT",
-						"MinEncKeySize", &err);
+						"MinEncryptionKeySize", &err);
+
+	/* Retry with deprecated option on error. */
+	if (err) {
+		DBG("%s", err->message);
+		g_clear_error(&err);
+		val = g_key_file_get_integer(config, "GATT",
+							"MinEncKeySize", &err);
+	}
+
 	if (err) {
 		DBG("%s", err->message);
 		g_clear_error(&err);
 	} else {
-		DBG("MinEncKeySize=%d", val);
+		DBG("MinEncryptionKeySize=%d", val);
 
 		if (val >=7 && val <= 16)
 			main_opts.min_enc_key_size = val;
diff --git a/src/main.conf b/src/main.conf
index c503040a5..4b0ae757b 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -63,7 +63,7 @@
 # Possible values: "off", "device", "network"
 # "network" option not supported currently
 # Defaults to "off"
-# Privacy = off
+#Privacy = off
 
 [GATT]
 # GATT attribute cache.
@@ -80,7 +80,7 @@
 # Minimum required Encryption Key Size for accessing secured characteristics.
 # Possible values: 0 and 7-16. 0 means don't care.
 # Defaults to 0
-# MinEncKeySize = 0
+#MinEncryptionKeySize = 0
 
 # Default LE MTU size.
 # Possible values: 23-517
-- 
2.18.0

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux