Bluetooth: Fix Add Device response status
Subsystems (2)
PATCH 1/1 Bluetooth: Fix Add Device response status
Make sure that MGMT_STATUS_INVALID_PARAMS is returned when non identity address is passed to ADD_DEVICE. Right now MGMT_STATUS_FAILED is returned, which might be misleading.
--- net/bluetooth/mgmt.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/bluetooth/mgmt.c +7 -0
@@ -6226,6 +6226,13 @@ static int add_device(struct sock *sk, struct hci_dev *hdev,else auto_conn =HCI_AUTO_CONN_REPORT ; +/* Allow only identity addresses */ +if (!hci_is_identity_address (&cp->addr.bdaddr, addr_type)) { + err = cmd->cmd_complete (cmd,MGMT_STATUS_INVALID_PARAMS ); +mgmt_pending_remove (cmd); + goto unlock; + } +/* If the connection parameters don't exist for this device, * they will be created and configured with defaults. */
Signature · 1 line
2.1.4
Marcel Holtmann
maintainerHi Jakub,
Quoted 14 lines
Make sure that
MGMT_STATUS_INVALID_PARAMSis returned when non identity address is passed toADD_DEVICE. Right nowMGMT_STATUS_FAILEDis returned, which might be misleading.Signed-off-by Jakub Pawlowski <[email protected]>---
net/bluetooth/mgmt.c| 7 +++++++1 file changed, 7 insertions(+)net/bluetooth/mgmt.c +0
-0
net/bluetooth/mgmt.c static int add_device(struct sock *sk, struct hci_dev *hdev, · line 6235
Quoted 10 lines
net/bluetooth/mgmt.c +7
-0@@ -6226,6 +6226,13 @@ static int add_device(struct sock *sk, struct hci_dev *hdev,else auto_conn =HCI_AUTO_CONN_REPORT ; +/* Allow only identity addresses */ +if (!hci_is_identity_address (&cp->addr.bdaddr, addr_type)) { + err = cmd->cmd_complete (cmd,MGMT_STATUS_INVALID_PARAMS ); +mgmt_pending_remove (cmd); + goto unlock; + } +
did we loose this patch or is it no longer needed?
Regards
Marcel
Quoted 19 lines · Marcel Holtmann
Hi Jakub,
Quoted 17 lines
Make sure that
MGMT_STATUS_INVALID_PARAMSis returned when non identity address is passed toADD_DEVICE. Right nowMGMT_STATUS_FAILEDis returned, which might be misleading.Signed-off-by Jakub Pawlowski <[email protected]>---
net/bluetooth/mgmt.c| 7 +++++++1 file changed, 7 insertions(+)net/bluetooth/mgmt.c +0
-0@@ -6226,6 +6226,13 @@ static int add_device(struct sock *sk, struct hci_dev *hdev,else auto_conn =HCI_AUTO_CONN_REPORT ;
Quoted 10 lines
net/bluetooth/mgmt.c static int add_device(struct sock *sk, struct hci_dev *hdev, · line 6235
Quoted 7 lines
net/bluetooth/mgmt.c +7
-0+/* Allow only identity addresses */ +if (!hci_is_identity_address (&cp->addr.bdaddr, addr_type)) { + err = cmd->cmd_complete (cmd,MGMT_STATUS_INVALID_PARAMS ); +mgmt_pending_remove (cmd); + goto unlock; + } +did we loose this patch or is it no longer needed?
It's no longer needed, it was squashed with other patch. Thanks,
Jakub
Quoted 4 lines
Regards
Marcel