From 313d3a26efa0f673250793a9a1e164d86e0a6425 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 21 Oct 2019 21:30:56 +0200 Subject: [PATCH] l2cap-ertm: use Retransmission and Flow Control options for ERTM only if supported by remote and channel ready to use it --- src/l2cap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/l2cap.c b/src/l2cap.c index d7447b147..5c3fa8e37 100644 --- a/src/l2cap.c +++ b/src/l2cap.c @@ -1406,8 +1406,8 @@ static int l2cap_ertm_mode(l2cap_channel_t * channel){ static uint16_t l2cap_setup_options_request(l2cap_channel_t * channel, uint8_t * config_options){ #ifdef ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE - // use ERTM options if supported - if (l2cap_ertm_mode(channel)){ + // use ERTM options if supported by remote and channel ready to use it + if (l2cap_ertm_mode(channel) && channel->mode == L2CAP_CHANNEL_MODE_ENHANCED_RETRANSMISSION){ return l2cap_setup_options_ertm_request(channel, config_options); } #endif