• Johan Hedberg's avatar
    Bluetooth: Fix incorrect clearing of SMP_FLAG_INITIATOR · c072d546
    Johan Hedberg authored
    When the SMP context is created all flags default to zero. To determine
    that we are the initiators it's therefore best to simply change the flag
    value when we know we're sending the first SMP PDU. Clearing the flag
    when receiving a Pairing Request is not correct since the request may be
    a response to a previous Security Request from us (for which we would
    already have correctly set the flag). Same goes for receiving a Security
    Request which may be coming after us already starting pairing by sending
    a Pairing Request.
    Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
    Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
    c072d546
smp.c 33.9 KB