Skip to content

Commit

Permalink
[nrf fromtree] 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]>
(cherry picked from commit 903672c)
  • Loading branch information
MarekPieta authored and anangl committed May 24, 2022
1 parent b821eb6 commit dd316f3
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 @@ -3085,7 +3085,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 dd316f3

Please sign in to comment.