Skip to content

Commit

Permalink
bluetooth: att: Fix L2CAP channel section order
Browse files Browse the repository at this point in the history
The L2CAP channel section is sorted lexicographically. Make sure
that ATT fixed channel will be placed as the last one to ensure
that SMP channel is properly initialized before bt_att_connected
tries to send security request.

Fixes zephyrproject-rtos#45820

Signed-off-by: Marek Pieta <[email protected]>
  • Loading branch information
MarekPieta authored and laxiLang committed May 30, 2022
1 parent f6b0829 commit 4ef6b2a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion subsys/bluetooth/host/att.c
Original file line number Diff line number Diff line change
Expand Up @@ -3173,7 +3173,11 @@ static int bt_att_accept(struct bt_conn *conn, struct bt_l2cap_chan **ch)
return 0;
}

BT_L2CAP_CHANNEL_DEFINE(att_fixed_chan, BT_L2CAP_CID_ATT, bt_att_accept, NULL);
/* The L2CAP channel section is sorted lexicographically. Make sure that ATT fixed channel will be
* placed as the last one to ensure that SMP channel is properly initialized before bt_att_connected
* tries to send security request.
*/
BT_L2CAP_CHANNEL_DEFINE(z_att_fixed_chan, BT_L2CAP_CID_ATT, bt_att_accept, NULL);

#if defined(CONFIG_BT_EATT)
static k_timeout_t credit_based_connection_delay(struct bt_conn *conn)
Expand Down

0 comments on commit 4ef6b2a

Please sign in to comment.