You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/10/09 11:45:13 UTC

[GitHub] [mynewt-nimble] sjanc commented on a change in pull request #871: nimble/ll: Fix stuck in the encryption process

sjanc commented on a change in pull request #871:
URL: https://github.com/apache/mynewt-nimble/pull/871#discussion_r502371188



##########
File path: nimble/controller/src/ble_ll_conn.c
##########
@@ -1015,8 +1015,14 @@ ble_ll_conn_tx_pdu(struct ble_ll_conn_sm *connsm)
         /*
          * If we are encrypting, we are only allowed to send certain
          * kinds of LL control PDU's. If none is enqueued, send empty pdu!
+         *
+         * In Slave role, we are allowed to send unencrypted packets until
+         * LL_ENC_RSP is sent.
          */
-        if (connsm->enc_data.enc_state > CONN_ENC_S_ENCRYPTED) {
+        if (((connsm->enc_data.enc_state > CONN_ENC_S_ENCRYPTED) &&
+              CONN_IS_MASTER(connsm)) ||
+              ((connsm->enc_data.enc_state > CONN_ENC_S_ENC_RSP_TO_BE_SENT) &&
+              !CONN_IS_MASTER(connsm))) {

Review comment:
       we also have CONN_IS_SLAVE macro :)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org