Bluetooth: l2cap: Fix error code for SCID in use

If we receive a connect request for an SCID that's already allocated
we should return the appropriate "SCID in use" error for it instead of
"No resources".

Change-Id: I1c1e1bba7059c8a37a8cc01c4bb2f3fbd7aab67d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2015-11-02 08:44:55 +02:00 committed by Anas Nashif
commit d858444eb5

View file

@ -395,7 +395,7 @@ static void le_conn_req(struct bt_l2cap *l2cap, uint8_t ident,
chan = bt_l2cap_lookup_tx_cid(conn, scid);
if (chan) {
rsp->dcid = req->scid;
rsp->result = BT_L2CAP_ERR_NO_RESOURCES;
rsp->result = BT_L2CAP_ERR_SCID_IN_USE;
goto rsp;
}