Skip to contentSkip to conversation

Bluetooth: Fix LE SMP channel source address and source address type

PATCH New Marcel Holtmann 1 participant 1 message Jan 15, 2015

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH v2 1/3 Bluetooth: Fix LE SMP channel source address and source address type

The source address and source address type of the LE SMP channel can either be the public address of the controller or the static random address configured by the host.

Right now the public address is used for the LE SMP channel and obviously that is not correct if the controller operates with the configured static random address.

---
 net/bluetooth/smp.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
net/bluetooth/smp.c +6 -4
index 04e49f8f0982..c201cd1005e4 100644
@@ -2950,11 +2950,13 @@ create_chan:
 
 	l2cap_chan_set_defaults(chan);
 
-	bacpy(&chan->src, &hdev->bdaddr);
-	if (cid == L2CAP_CID_SMP)
-		chan->src_type = BDADDR_LE_PUBLIC;
-	else
+	if (cid == L2CAP_CID_SMP) {
+		hci_copy_identity_address(hdev, &chan->src, &chan->src_type);
+	} else {
+		bacpy(&chan->src, &hdev->bdaddr);
 		chan->src_type = BDADDR_BREDR;
+	}
+
 	chan->state = BT_LISTEN;
 	chan->mode = L2CAP_MODE_BASIC;
 	chan->imtu = L2CAP_DEFAULT_MTU;
Signature · 1 line
2.1.0