From 45500f3dc979b4b827925693de08f90653b4b35d Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Tue, 24 Mar 2020 12:53:40 +0530 Subject: [PATCH] Bluetooth: controller: split: Fix DLE duplicate requests Fix implementation to handle back-to-back and duplicate LENGTH_REQ PDU reception. Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/ll_sw/ull_conn.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn.c b/subsys/bluetooth/controller/ll_sw/ull_conn.c index 236cecccb77..689caba3b1b 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn.c @@ -4678,9 +4678,20 @@ static inline int length_req_rsp_recv(struct ll_conn *conn, memq_link_t *link, #endif /* CONFIG_BT_CTLR_PHY */ } } else { - /* Drop response with no Local initiated request. */ - LL_ASSERT(pdu_rx->llctrl.opcode == - PDU_DATA_LLCTRL_TYPE_LENGTH_RSP); + /* Drop response with no Local initiated request and duplicate + * requests. + */ + if (pdu_rx->llctrl.opcode != PDU_DATA_LLCTRL_TYPE_LENGTH_RSP) { + mem_release(tx, &mem_conn_tx_ctrl.free); + + /* Defer new request if previous in resize state */ + if (conn->llcp_length.state == + LLCP_LENGTH_STATE_RESIZE) { + return -EBUSY; + } + } + + return 0; } send_length_resp: