Bluetooth: Update adv. parameters when conn. setting changes
authorArman Uguray <armansito@chromium.org>
Sat, 28 Mar 2015 19:39:00 +0000 (12:39 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 28 Mar 2015 20:31:57 +0000 (21:31 +0100)
This patch fixes a bug where the advertising parameters weren't updated
after a call to "Set Connectable" if the HCI_ADVERTISING_INSTANCE
setting was set.

Signed-off-by: Arman Uguray <armansito@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/mgmt.c

index 2d84fc1..29cbd98 100644 (file)
@@ -2113,7 +2113,8 @@ static int set_connectable(struct sock *sk, struct hci_dev *hdev, void *data,
 
 no_scan_update:
        /* Update the advertising parameters if necessary */
-       if (hci_dev_test_flag(hdev, HCI_ADVERTISING))
+       if (hci_dev_test_flag(hdev, HCI_ADVERTISING) ||
+           hci_dev_test_flag(hdev, HCI_ADVERTISING_INSTANCE))
                enable_advertising(&req);
 
        err = hci_req_run(&req, set_connectable_complete);