You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ko...@apache.org on 2021/11/22 11:38:29 UTC

[mynewt-nimble] branch master updated: host/l2cap_sig: MPS on any channel cannot be decreased

This is an automated email from the ASF dual-hosted git repository.

kopyscinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new f44ab19  host/l2cap_sig: MPS on any channel cannot be decreased
f44ab19 is described below

commit f44ab19694bfcb5824fef58471b586e20086992b
Author: Krzysztof Kopyściński <kr...@codecoup.pl>
AuthorDate: Thu Nov 18 07:41:49 2021 +0100

    host/l2cap_sig: MPS on any channel cannot be decreased
    
    If reconfiguration request contains >1 CID and MPS value is reduced for
    only one of them this request should still fail.
    
    This is affecting L2CAP/ECFC/BI-04-C
---
 nimble/host/src/ble_l2cap_sig.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/nimble/host/src/ble_l2cap_sig.c b/nimble/host/src/ble_l2cap_sig.c
index 2a36161..b74f88a 100644
--- a/nimble/host/src/ble_l2cap_sig.c
+++ b/nimble/host/src/ble_l2cap_sig.c
@@ -796,10 +796,6 @@ ble_l2cap_sig_credit_base_reconfig_req_rx(uint16_t conn_handle,
 
         if (chan[i]->peer_coc_mps > req->mps) {
             reduction_mps++;
-            if (reduction_mps > 1) {
-                rsp->result = htole16(BLE_L2CAP_ERR_RECONFIG_REDUCTION_MPS_NOT_ALLOWED);
-                goto failed;
-            }
         }
 
         if (chan[i]->coc_tx.mtu > req->mtu) {
@@ -808,6 +804,11 @@ ble_l2cap_sig_credit_base_reconfig_req_rx(uint16_t conn_handle,
         }
     }
 
+    if (reduction_mps > 0 && cid_cnt > 1) {
+        rsp->result = htole16(BLE_L2CAP_ERR_RECONFIG_REDUCTION_MPS_NOT_ALLOWED);
+        goto failed;
+    }
+
     ble_hs_unlock();
 
     for (i = 0; i < cid_cnt; i++) {