Skip to content

Commit 62ebdc2

Browse files
rymanlukholtmann
authored andcommitted
Bluetooth: Fix incorrect bits for LE states
This patch fixes incorrect checks for LE states. Issues found when doing mgmt tests for scenario when Linux Kernel should do connectable advertising while connected. Signed-off-by: Łukasz Rymanowski <lukasz.rymanowski@codecoup.pl> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent 06633ee commit 62ebdc2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎net/bluetooth/hci_request.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -934,8 +934,8 @@ static bool is_advertising_allowed(struct hci_dev *hdev, bool connectable)
934934
/* Slave connection state and connectable mode bit 38
935935
* and scannable bit 21.
936936
*/
937-
if (connectable && (!(hdev->le_states[4] & 0x01) ||
938-
!(hdev->le_states[2] & 0x40)))
937+
if (connectable && (!(hdev->le_states[4] & 0x40) ||
938+
!(hdev->le_states[2] & 0x20)))
939939
return false;
940940
}
941941

@@ -948,7 +948,7 @@ static bool is_advertising_allowed(struct hci_dev *hdev, bool connectable)
948948
/* Master connection state and connectable mode bit 35 and
949949
* scannable 19.
950950
*/
951-
if (connectable && (!(hdev->le_states[4] & 0x10) ||
951+
if (connectable && (!(hdev->le_states[4] & 0x08) ||
952952
!(hdev->le_states[2] & 0x08)))
953953
return false;
954954
}

0 commit comments

Comments
 (0)