summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index fc275dca94f8..10caab587cca 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -6183,13 +6183,25 @@ void mgmt_device_connected(struct hci_dev *hdev, struct hci_conn *conn,
6183 6183
6184 ev->flags = __cpu_to_le32(flags); 6184 ev->flags = __cpu_to_le32(flags);
6185 6185
6186 if (name_len > 0) 6186 /* We must ensure that the EIR Data fields are ordered and
6187 eir_len = eir_append_data(ev->eir, 0, EIR_NAME_COMPLETE, 6187 * unique. Keep it simple for now and avoid the problem by not
6188 name, name_len); 6188 * adding any BR/EDR data to the LE adv.
6189 */
6190 if (conn->le_adv_data_len > 0) {
6191 memcpy(&ev->eir[eir_len],
6192 conn->le_adv_data, conn->le_adv_data_len);
6193 eir_len = conn->le_adv_data_len;
6194 } else {
6195 if (name_len > 0)
6196 eir_len = eir_append_data(ev->eir, 0, EIR_NAME_COMPLETE,
6197 name, name_len);
6189 6198
6190 if (conn->dev_class && memcmp(conn->dev_class, "\0\0\0", 3) != 0) 6199 if (conn->dev_class &&
6191 eir_len = eir_append_data(ev->eir, eir_len, 6200 memcmp(conn->dev_class, "\0\0\0", 3) != 0)
6192 EIR_CLASS_OF_DEV, conn->dev_class, 3); 6201 eir_len = eir_append_data(ev->eir, eir_len,
6202 EIR_CLASS_OF_DEV,
6203 conn->dev_class, 3);
6204 }
6193 6205
6194 ev->eir_len = cpu_to_le16(eir_len); 6206 ev->eir_len = cpu_to_le16(eir_len);
6195 6207