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 #45820

Signed-off-by: Marek Pieta <[email protected]>
  • Loading branch information
MarekPieta authored and carlescufi committed May 20, 2022
1 parent 01f4a64 commit 903672c
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 903672c

Please sign in to comment.