Skip to content

Commit dd1a8f8

Browse files
Mallikarjun Phulariholtmann
authored andcommitted
Bluetooth: Errata Service Release 8, Erratum 3253
L2CAP: New result values 0x0006 - Connection refused – Invalid Source CID 0x0007 - Connection refused – Source CID already allocated As per the ESR08_V1.0.0, 1.11.2 Erratum 3253, Page No. 54, "Remote CID invalid Issue". Applies to Core Specification versions: V5.0, V4.2, v4.1, v4.0, and v3.0 + HS Vol 3, Part A, Section 4.2, 4.3, 4.14, 4.15. Core Specification Version 5.0, Page No.1753, Table 4.6 and Page No. 1767, Table 4.14 New result values are added to l2cap connect/create channel response as 0x0006 - Connection refused – Invalid Source CID 0x0007 - Connection refused – Source CID already allocated Signed-off-by: Mallikarjun Phulari <mallikarjun.phulari@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent 571f739 commit dd1a8f8

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎include/net/bluetooth/l2cap.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ struct l2cap_conn_rsp {
277277
#define L2CAP_CR_SEC_BLOCK 0x0003
278278
#define L2CAP_CR_NO_MEM 0x0004
279279
#define L2CAP_CR_BAD_AMP 0x0005
280+
#define L2CAP_CR_INVALID_SCID 0x0006
281+
#define L2CAP_CR_SCID_IN_USE 0x0007
280282

281283
/* credit based connect results */
282284
#define L2CAP_CR_LE_SUCCESS 0x0000

‎net/bluetooth/l2cap_core.c‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3816,9 +3816,17 @@ static struct l2cap_chan *l2cap_connect(struct l2cap_conn *conn,
38163816

38173817
result = L2CAP_CR_NO_MEM;
38183818

3819+
/* Check for valid dynamic CID range (as per Erratum 3253) */
3820+
if (scid < L2CAP_CID_DYN_START || scid > L2CAP_CID_DYN_END) {
3821+
result = L2CAP_CR_INVALID_SCID;
3822+
goto response;
3823+
}
3824+
38193825
/* Check if we already have channel with that dcid */
3820-
if (__l2cap_get_chan_by_dcid(conn, scid))
3826+
if (__l2cap_get_chan_by_dcid(conn, scid)) {
3827+
result = L2CAP_CR_SCID_IN_USE;
38213828
goto response;
3829+
}
38223830

38233831
chan = pchan->ops->new_connection(pchan);
38243832
if (!chan)

0 commit comments

Comments
 (0)