Bluetooth: mgmt: Fix wrong opcode in the response for add_adv cmd
authorTedd Ho-Jeong An <tedd.an@intel.com>
Mon, 26 Jul 2021 20:22:36 +0000 (13:22 -0700)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 28 Jul 2021 22:42:24 +0000 (15:42 -0700)
This patch fixes the MGMT add_advertising command repsones with the
wrong opcode when it is trying to return the not supported error.

Fixes: cbbdfa6f33198 ("Bluetooth: Enable controller RPA resolution using Experimental feature")
Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/mgmt.c

index 3663f880df110f7709d7608d53d85d93b3d7031c..1e21e014efd2223bb5e68d51ad8f668fa5439c18 100644 (file)
@@ -7725,7 +7725,7 @@ static int add_advertising(struct sock *sk, struct hci_dev *hdev,
         * advertising.
         */
        if (hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY))
-               return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_ADVERTISING,
+               return mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING,
                                       MGMT_STATUS_NOT_SUPPORTED);
 
        if (cp->instance < 1 || cp->instance > hdev->le_num_of_adv_sets)