Skip to contentSkip to conversation

Bluetooth: Update source address and type for incoming LE connections

PATCH Applied Marcel Holtmann 2 participants 2 messages Oct 13, 2013

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: Update source address and type for incoming LE connections

The incoming LE connections do not have a proper source address and address type set. The connection needs to be set with the same values as used for advertising parameters.

---
 net/bluetooth/hci_event.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
net/bluetooth/hci_event.c +11 -0
index bbe2d29..aa6fed3 100644
@@ -3477,6 +3477,17 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 
 		conn->dst_type = ev->bdaddr_type;
 
+		/* The advertising parameters for own address type
+		 * define which source address and source address
+		 * type this connections has.
+		 */
+		if (bacmp(&conn->src, BDADDR_ANY)) {
+			conn->src_type = ADDR_LE_DEV_PUBLIC;
+		} else {
+			bacpy(&conn->src, &hdev->static_addr);
+			conn->src_type = ADDR_LE_DEV_RANDOM;
+		}
+
 		if (ev->role == LE_CONN_ROLE_MASTER) {
 			conn->out = true;
 			conn->link_mode |= HCI_LM_MASTER;
Signature · 1 line
1.8.3.1
#1 lore raw

Hi Marcel,

Quoted 8 lines · Marcel Holtmann

The incoming LE connections do not have a proper source address and address type set. The connection needs to be set with the same values as used for advertising parameters.

---
 net/bluetooth/hci_event.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Applied to bluetooth-next. Thanks.

Johan