Bluetooth: controller: Guard against race in conn. establishment

In the time between a NODE_RX_TYPE_CONNECTION node is sent from LLL and
demuxed in ULL, an ADV role disable may be executed.
This makes the LLL data referenced in the node NULL/invald, and
ull_conn_setup would operate on invalid data.

This commit introduces a check in ADV disable to disallow the operation
(including conn invalidation), if a connection has been initiated.

To prevent pipeline-queued prepares from advertising after disable has
been initiated, set 'cancelled' flag for immediate signalling to LLL.

Signed-off-by: Morten Priess <mtpr@oticon.com>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Morten Priess 2021-04-09 22:57:55 +02:00 committed by Anas Nashif
commit 07278fc98f
3 changed files with 45 additions and 7 deletions

View file

@ -64,6 +64,7 @@ struct lll_conn {
#if defined(CONFIG_BT_PERIPHERAL)
struct {
uint8_t initiated:1;
uint8_t cancelled:1;
uint8_t latency_enabled:1;
uint32_t window_widening_periodic_us;