• Johan Hedberg's avatar
    Bluetooth: Use hci_disconnect for immediate disconnection from SMP · 1e91c29e
    Johan Hedberg authored
    Relying on the l2cap_conn_del procedure (triggered through the
    l2cap_conn_shutdown API) to get the connection disconnected is not
    reliable as it depends on all users releasing (through hci_conn_drop)
    and that there's at least one user (so hci_conn_drop is called at least
    one time).
    
    A much simpler and more reliable solution is to call hci_disconnect()
    directly from the SMP code when we want to disconnect. One side-effect
    this has is that it prevents any SMP Failure PDU from being sent before
    the disconnection, however neither one of the scenarios where
    l2cap_conn_shutdown was used really requires this.
    Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
    Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
    1e91c29e
smp.c 40.6 KB