Bluetooth: Don't update responder for master role connection

Both initiator and responder addresses are already set during
connection creation so there is no need to set responder address
again.

Change-Id: Id477a9e6dd2244c57126d1f985aa41cd1b04650b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2016-05-05 12:03:44 +02:00
commit c3d71b5414

View file

@ -658,15 +658,12 @@ static void le_conn_complete(struct net_buf *buf)
conn->le.timeout = sys_le16_to_cpu(evt->supv_timeout);
conn->role = evt->role;
/* use connection address (instead of identity address) as initiator
* or responder address
/*
* Use connection address (instead of identity address) as initiator
* or responder address. Only slave needs to be updated. For master all
* was set during outgoing connection creation.
*/
if (conn->role == BT_HCI_ROLE_MASTER) {
bt_addr_le_copy(&conn->le.resp_addr, &evt->peer_addr);
/* init_addr doesn't need updating here since it was
* already set during previous steps.
*/
} else {
if (conn->role == BT_HCI_ROLE_SLAVE) {
bt_addr_le_copy(&conn->le.init_addr, &evt->peer_addr);
#if defined(CONFIG_BLUETOOTH_PRIVACY)