Diff between 219e1c6e50cf8f3fdfcf152962a5b0a4c2ae7bc3 and f71feab36538a02d9b4dbed549e52dcaa75384c9

Changed Files

File Additions Deletions Status
emulator/bthost.c +12 -6 modified

Full Patch

diff --git a/emulator/bthost.c b/emulator/bthost.c
index 5476852..4f1598f 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -951,14 +951,20 @@ static void init_conn(struct bthost *bthost, uint16_t handle,
 
 	if (bthost->conn_init) {
 		ia = bthost->bdaddr;
-		ia_type = addr_type;
-		ra = conn->bdaddr;
-		ra_type = conn->addr_type;
+		if (addr_type == BDADDR_BREDR)
+			ia_type = addr_type;
+		else
+			ia_type = BDADDR_LE_PUBLIC;
+		ra = bdaddr;
+		ra_type = addr_type;
 	} else {
-		ia = conn->bdaddr;
-		ia_type = conn->addr_type;
+		ia = bdaddr;
+		ia_type = addr_type;
 		ra = bthost->bdaddr;
-		ra_type = addr_type;
+		if (addr_type == BDADDR_BREDR)
+			ra_type = addr_type;
+		else
+			ra_type = BDADDR_LE_PUBLIC;
 	}
 
 	conn->smp_data = smp_conn_add(bthost->smp_data, handle, ia, ia_type,