diff --git a/CHANGELOG.md b/CHANGELOG.md index 941d9e662..ac9f375d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - HCI/L2CAP: Error creating outgoing connection (e.g. Connection Limit Exceeded) now handled - RFCOMM: Trigger l2cap request to send on rfcomm credits when client is waiting to sendtrigger l2cap request to send on rfcomm credits when client is waiting to send +- RFCOMM: Avoid use-after-free on channel finalize - L2CAP: Evaluate 'can send now' on HCI Disconnect as ACL buffers in Bluetooth Controller have been used for the closed connection are freed implicitly +- L2CAP: Check can send now before sending extended information requeste needed for ERTM mode - GATT Client: stop timer on disconnect - fixes use after free / crash - L2CAP: Use valid signaling identifier for L2CAP Connection Parameter Update Request diff --git a/src/l2cap.c b/src/l2cap.c index f8c962713..86ddf52dd 100644 --- a/src/l2cap.c +++ b/src/l2cap.c @@ -1371,8 +1371,8 @@ static void l2cap_run(void){ while(btstack_linked_list_iterator_has_next(&it)){ hci_connection_t * connection = (hci_connection_t *) btstack_linked_list_iterator_next(&it); if (connection->l2cap_state.information_state == L2CAP_INFORMATION_STATE_W2_SEND_EXTENDED_FEATURE_REQUEST){ + if (!hci_can_send_acl_packet_now(connection->con_handle)) break; connection->l2cap_state.information_state = L2CAP_INFORMATION_STATE_W4_EXTENDED_FEATURE_RESPONSE; - // send information request for extended features uint8_t sig_id = l2cap_next_sig_id(); uint8_t info_type = L2CAP_INFO_TYPE_EXTENDED_FEATURES_SUPPORTED; l2cap_send_signaling_packet(connection->con_handle, INFORMATION_REQUEST, sig_id, info_type);