main: Default device_privacy to true
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 13 Jul 2022 23:40:03 +0000 (16:40 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
If privacy mode is not strictly set to network set it to device
otherwise network mode would prevent reconnections if the the identity
address is used:

BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 6, Part B page 2837-2838

 'The Host specifies the privacy mode to be used with each peer
 identity on the resolving list. If it specifies that device privacy
 mode is to be used, then the Controller shall accept both the peer's
 device Identity Address and a resolvable private address generated by
 the peer device using its distributed IRK. Otherwise, network privacy
 mode is used: the Controller shall only accept resolvable private
 addresses generated by the peer device using its distributed IRK.'

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/main.c

index b661871..bcb6e52 100755 (executable)
@@ -703,6 +703,7 @@ static void parse_config(GKeyFile *config)
                DBG("%s", err->message);
                g_clear_error(&err);
                btd_opts.privacy = 0x00;
+               btd_opts.device_privacy = true;
        } else {
                DBG("privacy=%s", str);
 
@@ -726,6 +727,7 @@ static void parse_config(GKeyFile *config)
                        btd_opts.device_privacy = true;
                } else if (!strcmp(str, "off")) {
                        btd_opts.privacy = 0x00;
+                       btd_opts.device_privacy = true;
                } else {
                        DBG("Invalid privacy option: %s", str);
                        btd_opts.privacy = 0x00;