Skip to content

Commit b39cf80

Browse files
cvinayaknashif
authored andcommitted
Bluetooth: controller: legacy: Fix channel map check regression
Fix channel map check regression introduced in commit 2ca0b01 ("Bluetooth: controller: legacy: Validate chan map and hop value"), that caused further connection initiation to fail. Relates to commit 94d5f08 ("Bluetooth: controller: fixing error re. all zero chmap in conn-ind"). Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent da9ac45 commit b39cf80

File tree

1 file changed

+5
-5
lines changed
  • subsys/bluetooth/controller/ll_sw

1 file changed

+5
-5
lines changed

subsys/bluetooth/controller/ll_sw/ctrl.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,6 @@ static inline u32_t isr_rx_adv(u8_t devmatch_ok, u8_t devmatch_id,
10371037

10381038
/* acquire the slave context from advertiser */
10391039
conn = _radio.advertiser.conn;
1040-
_radio.advertiser.conn = NULL;
10411040

10421041
/* Populate the slave context */
10431042
conn->handle = mem_index_get(conn, _radio.conn_pool,
@@ -1054,13 +1053,14 @@ static inline u32_t isr_rx_adv(u8_t devmatch_ok, u8_t devmatch_id,
10541053
conn->data_chan_count =
10551054
util_ones_count_get(&conn->data_chan_map[0],
10561055
sizeof(conn->data_chan_map));
1057-
if (conn->data_chan_count < 2) {
1058-
return 1;
1059-
}
10601056
conn->data_chan_hop = pdu_adv->connect_ind.hop;
1061-
if ((conn->data_chan_hop < 5) || (conn->data_chan_hop > 16)) {
1057+
if ((conn->data_chan_count < 2) || (conn->data_chan_hop < 5) ||
1058+
(conn->data_chan_hop > 16)) {
10621059
return 1;
10631060
}
1061+
1062+
_radio.advertiser.conn = NULL;
1063+
10641064
conn->conn_interval =
10651065
pdu_adv->connect_ind.interval;
10661066
conn_interval_us =

0 commit comments

Comments
 (0)