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

Commit b525fa43 authored by Andre Eisenbach's avatar Andre Eisenbach Committed by android-build-merger
Browse files

Merge "Reject LE COC if cid is duplicated"

am: 4e56a4b8

Change-Id: I16e1c8bc032df0215f72187639fe9e8a31444192
parents 2b972c2a 4e56a4b8
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -136,6 +136,7 @@
#define L2CAP_LE_INSUFFICIENT_ENCRYP 8
#define L2CAP_LE_INSUFFICIENT_ENCRYP 8
/* We don't like peer device response */
/* We don't like peer device response */
#define L2CAP_LE_INVALID_SOURCE_CID 9
#define L2CAP_LE_INVALID_SOURCE_CID 9
#define L2CAP_LE_SOURCE_CID_ALREADY_ALLOCATED 0x0A


/* Define L2CAP Move Channel Response result codes
/* Define L2CAP Move Channel Response result codes
*/
*/
+8 −0
Original line number Original line 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",
          "initial credit = %d",
          mtu, mps, initial_credit);
          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);
      p_rcb = l2cu_find_ble_rcb_by_psm(con_info.psm);
      if (p_rcb == NULL) {
      if (p_rcb == NULL) {
        L2CAP_TRACE_WARNING("L2CAP - rcvd conn req for unknown PSM: 0x%04x",
        L2CAP_TRACE_WARNING("L2CAP - rcvd conn req for unknown PSM: 0x%04x",