To make is easier to track which keys we've received and which ones
we're still waiting for simply clear the corresponding key bits from
smp->remote_key_dist as they get received. This will allow us to
simplify the code for checking for SMP completion in subsequent patches.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
        if (!(smp->remote_key_dist & SMP_DIST_ENC_KEY))
                return 0;
 
+       /* Mark the information as received */
+       smp->remote_key_dist &= ~SMP_DIST_ENC_KEY;
+
        skb_pull(skb, sizeof(*rp));
 
        hci_dev_lock(hdev);
        if (!(smp->remote_key_dist & SMP_DIST_ID_KEY))
                return 0;
 
+       /* Mark the information as received */
+       smp->remote_key_dist &= ~SMP_DIST_ID_KEY;
+
        skb_pull(skb, sizeof(*info));
 
        /* Strictly speaking the Core Specification (4.1) allows sending