diff --git a/src/device.c b/src/device.c
index 8693eb8..50e7f23 100644
--- a/src/device.c
+++ b/src/device.c
struct btd_device {
int ref_count;
+ bdaddr_t conn_bdaddr;
+ uint8_t conn_bdaddr_type;
bdaddr_t bdaddr;
uint8_t bdaddr_type;
char *path;
return;
}
+ bacpy(&dev->conn_bdaddr, &dev->bdaddr);
+ dev->conn_bdaddr_type = dev->bdaddr_type;
+
/* If this is the first connection over this bearer */
if (bdaddr_type == BDADDR_BREDR)
device_set_bredr_support(dev);
if (!dev->le)
return -1;
- if (addr->bdaddr_type != dev->bdaddr_type)
+ if (addr->bdaddr_type != dev->bdaddr_type) {
+ if (addr->bdaddr_type == dev->conn_bdaddr_type)
+ return bacmp(&dev->conn_bdaddr, &addr->bdaddr);
return -1;
+ }
return cmp;
}