Do not load a dev info if no technology has 06/101006/1
authorSeungyoun Ju <sy39.ju@samsung.com>
Wed, 30 Nov 2016 05:30:12 +0000 (14:30 +0900)
committerInjun Yang <injun.yang@samsung.com>
Wed, 30 Nov 2016 05:30:12 +0000 (14:30 +0900)
[Problem] Old storage could have invalid directory. It causes paired
list corrupted
[Cause & Measure] Old bluez has some issues to store CSRK. It makes
invalid directory. It should be ignored when devices are loaded from
storage.

Change-Id: Ib18a4050f1d86145b2f53f8fff7629aebdff43ff
Signed-off-by: Injun Yang <injun.yang@samsung.com>
src/adapter.c

index 136a694..828f54f 100644 (file)
@@ -7593,7 +7593,7 @@ static uint8_t get_addr_type(GKeyFile *keyfile)
        techno = g_key_file_get_string_list(keyfile, "General",
                                        "SupportedTechnologies", NULL, NULL);
        if (!techno)
-               return BDADDR_BREDR;
+               return 0xff;
 
        for (t = techno; *t; t++) {
                if (g_str_equal(*t, "LE"))
@@ -7713,6 +7713,10 @@ static void load_devices(struct btd_adapter *adapter)
 #ifdef TIZEN_FEATURE_BLUEZ_MODIFY
                str2ba(entry->d_name, &addr.bdaddr);
                addr.bdaddr_type = get_addr_type(key_file);
+               if (addr.bdaddr_type == 0xff) {
+                       error("No SupportedTechnologies. Skipping");
+                       goto free;
+               }
 
                list = g_slist_find_custom(adapter->devices, &addr,
                                                device_addr_type_strict_cmp);