Skip to content

Commit e93b41a

Browse files
Michał Narajowskinashif
authored andcommitted
Bluetooth: host: Fix Limited Advertising timeout cancel
Timeout cancel should only be done for connections established in peripheral role. Enhanced connection complete event could still be delivered without extended advertising support (i.e no advertising set terminated event) so this handling should be moved to the common conn complete function. Fixes #37467 Signed-off-by: Michał Narajowski <[email protected]>
1 parent 295d13c commit e93b41a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

subsys/bluetooth/host/hci_core.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,7 @@ void bt_hci_le_enh_conn_complete(struct bt_hci_evt_le_enh_conn_complete *evt)
11601160
* object to keep host in sync with controller state.
11611161
*/
11621162
atomic_clear_bit(adv->flags, BT_ADV_ENABLED);
1163+
(void)bt_le_lim_adv_cancel_timeout(adv);
11631164
}
11641165

11651166
if (IS_ENABLED(CONFIG_BT_CENTRAL) &&
@@ -1324,12 +1325,6 @@ static void le_legacy_conn_complete(struct net_buf *buf)
13241325
struct bt_hci_evt_le_conn_complete *evt = (void *)buf->data;
13251326
struct bt_hci_evt_le_enh_conn_complete enh;
13261327

1327-
#if defined(CONFIG_BT_BROADCASTER)
1328-
struct bt_le_ext_adv *adv = bt_le_adv_lookup_legacy();
1329-
1330-
(void)bt_le_lim_adv_cancel_timeout(adv);
1331-
#endif
1332-
13331328
BT_DBG("status 0x%02x role %u %s", evt->status, evt->role,
13341329
bt_addr_le_str(&evt->peer_addr));
13351330

0 commit comments

Comments
 (0)