@@ -6319,7 +6319,7 @@ static void le_ltk_request(struct pdu_data *pdu_data, uint16_t handle,
6319
6319
}
6320
6320
6321
6321
static void encrypt_change (uint8_t err , uint16_t handle ,
6322
- struct net_buf * buf )
6322
+ struct net_buf * buf , bool encryption_on )
6323
6323
{
6324
6324
struct bt_hci_evt_encrypt_change * ep ;
6325
6325
@@ -6332,7 +6332,7 @@ static void encrypt_change(uint8_t err, uint16_t handle,
6332
6332
6333
6333
ep -> status = err ;
6334
6334
ep -> handle = sys_cpu_to_le16 (handle );
6335
- ep -> encrypt = ! err ? 1 : 0 ;
6335
+ ep -> encrypt = encryption_on ? 1 : 0 ;
6336
6336
}
6337
6337
#endif /* CONFIG_BT_CTLR_LE_ENC */
6338
6338
@@ -6457,7 +6457,7 @@ static void encode_data_ctrl(struct node_rx_pdu *node_rx,
6457
6457
break ;
6458
6458
6459
6459
case PDU_DATA_LLCTRL_TYPE_START_ENC_RSP :
6460
- encrypt_change (0x00 , handle , buf );
6460
+ encrypt_change (0x00 , handle , buf , true );
6461
6461
break ;
6462
6462
#endif /* CONFIG_BT_CTLR_LE_ENC */
6463
6463
@@ -6474,7 +6474,7 @@ static void encode_data_ctrl(struct node_rx_pdu *node_rx,
6474
6474
#if defined(CONFIG_BT_CTLR_LE_ENC )
6475
6475
case PDU_DATA_LLCTRL_TYPE_REJECT_IND :
6476
6476
encrypt_change (pdu_data -> llctrl .reject_ind .error_code , handle ,
6477
- buf );
6477
+ buf , false );
6478
6478
break ;
6479
6479
#endif /* CONFIG_BT_CTLR_LE_ENC */
6480
6480
0 commit comments