diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2020-12-17 15:18:29 -0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2020-12-17 16:12:39 -0800 |
commit | 07cc7547602149fbec5eee1a353f48663d5e80c4 (patch) | |
tree | b76d3cf300cf6ac882ef1ce197ba14ba845e0cf3 /emulator/bthost.c | |
parent | 77d6ee6fbd8c7a38347189f061b27180193b3603 (diff) | |
download | bluez-07cc7547602149fbec5eee1a353f48663d5e80c4.tar.gz |
bthost: Add support for address types other then public
This properly initialize the address type according to the connection
address.
Diffstat (limited to 'emulator/bthost.c')
-rw-r--r-- | emulator/bthost.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/emulator/bthost.c b/emulator/bthost.c index 3b42c0664..16934d35a 100644 --- a/emulator/bthost.c +++ b/emulator/bthost.c @@ -923,6 +923,7 @@ static void init_conn(struct bthost *bthost, uint16_t handle, { struct btconn *conn; const uint8_t *ia, *ra; + uint8_t ia_type, ra_type; conn = malloc(sizeof(*conn)); if (!conn) @@ -939,14 +940,18 @@ 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; } else { ia = conn->bdaddr; + ia_type = conn->addr_type; ra = bthost->bdaddr; + ra_type = addr_type; } - conn->smp_data = smp_conn_add(bthost->smp_data, handle, ia, ra, - addr_type, bthost->conn_init); + conn->smp_data = smp_conn_add(bthost->smp_data, handle, ia, ia_type, + ra, ra_type, bthost->conn_init); if (bthost->new_conn_cb) bthost->new_conn_cb(conn->handle, bthost->new_conn_data); |