Bluetooth: Don't advertise high speed support without SSP
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 11 Oct 2013 16:48:47 +0000 (09:48 -0700)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 11 Oct 2013 17:48:13 +0000 (19:48 +0200)
It is not allowed to enable high speed support when Secure Simple
Pairing is not available or disabled.

However the support for high speed gets advertised on a controller
that does not even support Secure Simple Pairing. Since there is
no way to enable high speed support on such a controller, do not
even advertise its support.

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

index f57ec19547afc47ff8d46c365ba7ce287c7693a1..aa59490044aa41b4fd7fbe85f26510848e1c0967 100644 (file)
@@ -363,9 +363,6 @@ static u32 get_supported_settings(struct hci_dev *hdev)
        settings |= MGMT_SETTING_POWERED;
        settings |= MGMT_SETTING_PAIRABLE;
 
-       if (lmp_ssp_capable(hdev))
-               settings |= MGMT_SETTING_SSP;
-
        if (lmp_bredr_capable(hdev)) {
                settings |= MGMT_SETTING_CONNECTABLE;
                if (hdev->hci_ver >= BLUETOOTH_VER_1_2)
@@ -373,7 +370,11 @@ static u32 get_supported_settings(struct hci_dev *hdev)
                settings |= MGMT_SETTING_DISCOVERABLE;
                settings |= MGMT_SETTING_BREDR;
                settings |= MGMT_SETTING_LINK_SECURITY;
-               settings |= MGMT_SETTING_HS;
+
+               if (lmp_ssp_capable(hdev)) {
+                       settings |= MGMT_SETTING_SSP;
+                       settings |= MGMT_SETTING_HS;
+               }
        }
 
        if (lmp_le_capable(hdev)) {