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

Commit 11693786 authored by Jaganath Kanakkassery's avatar Jaganath Kanakkassery Committed by Stanley Tng
Browse files

Reject LE COC if cid is duplicated



This is for PTS test TP/LE/CFC/BV-20-C.

The scenario is there is already one COC between DUT and PTS.
Then PTS tries to establish one more COC with same cid which
should be rejected.

Test: PTS test TP/LE/CFC/BV-20-C done by Intel (originator
of this change).

Change-Id: I094a4058ac0e7bb9d7344e66d9feafee17bc3d53
Signed-off-by: default avatarJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
(cherry picked from commit a0b5ff41)
parent fde36f27
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -136,6 +136,7 @@
#define L2CAP_LE_INSUFFICIENT_ENCRYP 8
/* We don't like peer device response */
#define L2CAP_LE_INVALID_SOURCE_CID 9
#define L2CAP_LE_SOURCE_CID_ALREADY_ALLOCATED 0x0A

/* Define L2CAP Move Channel Response result codes
*/
+8 −0
Original line number Diff line number Diff line
@@ -668,6 +668,14 @@ void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
          "initial credit = %d",
          mtu, mps, initial_credit);

      p_ccb = l2cu_find_ccb_by_remote_cid(p_lcb, rcid);
      if (p_ccb) {
        L2CAP_TRACE_WARNING("L2CAP - rcvd conn req for duplicated cid: 0x%04x",
                            rcid);
        l2cu_reject_ble_connection(p_lcb, id, L2CAP_LE_SOURCE_CID_ALREADY_ALLOCATED);
        break;
      }

      p_rcb = l2cu_find_ble_rcb_by_psm(con_info.psm);
      if (p_rcb == NULL) {
        L2CAP_TRACE_WARNING("L2CAP - rcvd conn req for unknown PSM: 0x%04x",