@@ -8516,7 +8516,7 @@ static void le_ltk_request(struct pdu_data *pdu_data, uint16_t handle,
8516
8516
}
8517
8517
8518
8518
static void encrypt_change (uint8_t err , uint16_t handle ,
8519
- struct net_buf * buf )
8519
+ struct net_buf * buf , bool encryption_on )
8520
8520
{
8521
8521
struct bt_hci_evt_encrypt_change * ep ;
8522
8522
@@ -8529,7 +8529,7 @@ static void encrypt_change(uint8_t err, uint16_t handle,
8529
8529
8530
8530
ep -> status = err ;
8531
8531
ep -> handle = sys_cpu_to_le16 (handle );
8532
- ep -> encrypt = ! err ? 1 : 0 ;
8532
+ ep -> encrypt = encryption_on ? 1 : 0 ;
8533
8533
}
8534
8534
#endif /* CONFIG_BT_CTLR_LE_ENC */
8535
8535
@@ -8671,7 +8671,7 @@ static void encode_data_ctrl(struct node_rx_pdu *node_rx,
8671
8671
break ;
8672
8672
8673
8673
case PDU_DATA_LLCTRL_TYPE_START_ENC_RSP :
8674
- encrypt_change (0x00 , handle , buf );
8674
+ encrypt_change (0x00 , handle , buf , true );
8675
8675
break ;
8676
8676
#endif /* CONFIG_BT_CTLR_LE_ENC */
8677
8677
@@ -8688,7 +8688,7 @@ static void encode_data_ctrl(struct node_rx_pdu *node_rx,
8688
8688
#if defined(CONFIG_BT_CTLR_LE_ENC )
8689
8689
case PDU_DATA_LLCTRL_TYPE_REJECT_IND :
8690
8690
encrypt_change (pdu_data -> llctrl .reject_ind .error_code , handle ,
8691
- buf );
8691
+ buf , false );
8692
8692
break ;
8693
8693
#endif /* CONFIG_BT_CTLR_LE_ENC */
8694
8694
0 commit comments