Skip to content

Commit

Permalink
Bluetooth: controller: Workaround for Unknown Rsp during Enc Setup
Browse files Browse the repository at this point in the history
Some old peer central controllers respond with Unknown
Response PDU to our local Slave Initiated Feature Request
after the peer initiated the Encryption Setup Procedure.

The peer has voilated the Bluetooth Specification by sending
the Unknown Response during the Encryption Setup Procedure,
but as a workaround to IOP with such controller our local
implementation is updated to not disconnect the connection
but accept the voilating Unknown Response PDU.

Relates to #12362.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
  • Loading branch information
cvinayak authored and carlescufi committed Mar 1, 2019
1 parent 6e2501d commit 5f2099f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions subsys/bluetooth/controller/ll_sw/ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3422,6 +3422,13 @@ static inline bool isr_rx_conn_enc_unexpected(struct connection *conn,
(opcode != PDU_DATA_LLCTRL_TYPE_REJECT_EXT_IND)))) ||
(conn->role &&
((!conn->refresh &&
/* As a workaround to IOP with some old peer controllers that
* respond with Unknown Rsp PDU to our local Slave Initiated
* Feature request during Encryption Setup initiated by the
* peer, we accept this Unknown Rsp PDU during the Encryption
* setup procedure in progress.
*/
(opcode != PDU_DATA_LLCTRL_TYPE_UNKNOWN_RSP) &&
(opcode != PDU_DATA_LLCTRL_TYPE_TERMINATE_IND) &&
(opcode != PDU_DATA_LLCTRL_TYPE_START_ENC_RSP) &&
(opcode != PDU_DATA_LLCTRL_TYPE_REJECT_IND) &&
Expand Down
7 changes: 7 additions & 0 deletions subsys/bluetooth/controller/ll_sw/ull_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -3111,6 +3111,13 @@ static inline bool ctrl_is_unexpected(struct ll_conn *conn, u8_t opcode)
(opcode != PDU_DATA_LLCTRL_TYPE_REJECT_EXT_IND)))) ||
(conn->lll.role &&
((!conn->refresh &&
/* As a workaround to IOP with some old peer controllers that
* respond with Unknown Rsp PDU to our local Slave Initiated
* Feature request during Encryption Setup initiated by the
* peer, we accept this Unknown Rsp PDU during the Encryption
* setup procedure in progress.
*/
(opcode != PDU_DATA_LLCTRL_TYPE_UNKNOWN_RSP) &&
(opcode != PDU_DATA_LLCTRL_TYPE_TERMINATE_IND) &&
(opcode != PDU_DATA_LLCTRL_TYPE_START_ENC_RSP) &&
(opcode != PDU_DATA_LLCTRL_TYPE_REJECT_IND) &&
Expand Down

0 comments on commit 5f2099f

Please sign in to comment.