Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 428197f8 authored by Huirong Liao's avatar Huirong Liao
Browse files

Fix when gatt disconnect too fast, RC pair fail

[Root Cause]
when disconnect too fast and link_state is still DISCONNECTED,
in release_ccb, only lcb released, ACL link will not removed.
When this case happend, disc_comp will have no lcb,
then auto connection will fail cuz last ACL exists.

[Solution]
Set link_state as LST_CONNECTING to avoid this case.

Bug: 264734928
Test: atest net_test_stack_l2cap pass

Change-Id: Ia8e86c3dbaa702c1c115c4e4cb7a21d6955b8aeb
parent 4c9cb86c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -262,6 +262,7 @@ bool l2cble_conn_comp(uint16_t handle, uint8_t role, const RawAddress& bda,
        return false;
      }
    }
    p_lcb->link_state = LST_CONNECTING;
  } else if (role == HCI_ROLE_CENTRAL && p_lcb->link_state != LST_CONNECTING) {
    LOG_ERROR(
        "Received le acl connection as role central but not in connecting "