[PATCH BlueZ] main.conf: Fix Privacy modes

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

Device privacy 0x01 uses RPA regardless of the discoverable setting thus
it conforms to network mode not device mode.

Also this improves documentation to state what is the expectation of
each mode since it may not have been very clear by just using the terms
from the spec.
---
 src/main.c    |  4 +++-
 src/main.conf | 10 ++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/main.c b/src/main.c
index 5ca8d5644..3c9ab231e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -666,8 +666,10 @@ static void parse_config(GKeyFile *config)
 	} else {
 		DBG("privacy=%s", str);
 
-		if (!strcmp(str, "device"))
+		if (!strcmp(str, "network") || !strcmp(str, "on"))
 			btd_opts.privacy = 0x01;
+		if (!strcmp(str, "device"))
+			btd_opts.privacy = 0x02;
 		else if (!strcmp(str, "off"))
 			btd_opts.privacy = 0x00;
 		else {
diff --git a/src/main.conf b/src/main.conf
index e05291d8e..919675185 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -67,8 +67,14 @@
 
 # Default privacy setting.
 # Enables use of private address.
-# Possible values: "off", "device", "network"
-# "network" option not supported currently
+# Possible values: "off", "network/on", "device"
+# "network": a device will only accept advertising packets from peer devices
+# that contain private addresses. It may not be compatible with some legacy
+# devices since it requires the use of RPA(s) all the time.
+# "device": A device in device privacy mode is only concerned about the privacy
+# of the device and will accept advertising packets from peer devices that
+# contain their Identity Address as well as ones that contain a private address,
+# even if the peer device has distributed its IRK in the past.
 # Defaults to "off"
 #Privacy = off
 
-- 
2.31.1




[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