Bluetooth: Fix clearing HCI_LE_ADV for LE connections
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 8 Jul 2014 14:21:51 +0000 (17:21 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 8 Jul 2014 14:27:44 +0000 (16:27 +0200)
All LE controllers always implicitly stop advertising when establishing
connections. Therefore, be sure to clear the flag in the event handler
for new LE connections.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_event.c

index 2b3d366e5d98efb2369c86c65857a51608eca105..f6997901bdd7f6581d8ba0ce358fe5702fd87be7 100644 (file)
@@ -4097,6 +4097,11 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 
        hci_dev_lock(hdev);
 
+       /* All controllers implicitly stop advertising in the event of a
+        * connection, so ensure that the state bit is cleared.
+        */
+       clear_bit(HCI_LE_ADV, &hdev->dev_flags);
+
        conn = hci_conn_hash_lookup_state(hdev, LE_LINK, BT_CONNECT);
        if (!conn) {
                conn = hci_conn_add(hdev, LE_LINK, &ev->bdaddr);