Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp514726ybh; Tue, 10 Mar 2020 03:10:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtvEaDzFtEIutMNDtIYJ1mFspDiBGVeKqTrQIMxIr8OHd3p8cTUyR7QmwyT3hDX+2tPP2G2 X-Received: by 2002:a54:4119:: with SMTP id l25mr556011oic.83.1583835000033; Tue, 10 Mar 2020 03:10:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583835000; cv=none; d=google.com; s=arc-20160816; b=ccwUMBvO3k+Em2oDIzKQQOTu7t0uBM6QP5w6Bj/flZr6utVOXWgXr93ghe9irTRTFC VxndbAfP5voHj3PGB9vfWSAxJkvnLsQRT7bvzaQr6gtRhlTURtzIGIXxWRZRL/N/Gtim xbUFjhxvYS7RDqAdefu8mp1FWrCW5OMaBoTsT7RRIkvObiD0dRp/EFgcRc/+RU9bx8HP mPnoLZbAq4vFrQxe7ZgRSRPRFcCyfBRqn+YK3VwA9tsKnYjUyQSSE483u3PsnJfOaxFS VEg90O3+No8OJCFeberSTHohq0F7YyIly1nfG85vn6f8msEHMsxsuOqNmJ3gyozC+cSd WKVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=qgIz8ZXqxR+qL3nvVcdKU+rwgX72c7Lhu1jYDVFQ+gU=; b=yxtrFLSD5sCIPUFOgF7p5o7Q8xSMJJJ/Gx+d/XHq0y5rst4pMobh1O+CUlPArRMlC9 yhuEYYXz4px1NfCpy/zsJkRYdhAWYdT+rQ5NltCJ9uFYfbZU1bNRWuv2H4oj7xtiPH9g J+44YE+Tqme3ELwe430SsloFd97e9fdLPEKApwimsx0/TiiJqADvuaSgJp7+Zb0dTqjq jdHzh7O3NzcZH26r6Kb6caUfif5EMMLtgwTm09YbQQ5jlNRS5Oh82houLqMh+af05BhF wf26UE4HHbri79pADPV5m65fTUyaLsajR/NnU+UXK13ouZfBFFwvPiQ0DQYSFs+qcPP9 gJ6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QQbeqMhe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i18si7568499otk.245.2020.03.10.03.09.47; Tue, 10 Mar 2020 03:10:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QQbeqMhe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726202AbgCJKJC (ORCPT + 99 others); Tue, 10 Mar 2020 06:09:02 -0400 Received: from mail-pl1-f202.google.com ([209.85.214.202]:41693 "EHLO mail-pl1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726244AbgCJKJC (ORCPT ); Tue, 10 Mar 2020 06:09:02 -0400 Received: by mail-pl1-f202.google.com with SMTP id u3so3524338plm.8 for ; Tue, 10 Mar 2020 03:09:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=qgIz8ZXqxR+qL3nvVcdKU+rwgX72c7Lhu1jYDVFQ+gU=; b=QQbeqMhejQGLjzt6M3ysCxg/Kr0sB595VzRhzxXl1Qyg5zKnJoZVhIlwh37+vavyil 83/8JvZT0fqzcjkaWOByFkuvWlIzxNDAUYUwvmlbNKoYUmavJoJJNvyyZjFscJ5KXAjo 75irtwgv8v8foPo0mFf0/EjXqruZYB/MJFvg6aFl1s6bqF615/TI7e8njU1uYqrdfZ99 ZMJGSgtji0wRcNyeB4kj7VHuDvUPYY6MkYZWsjPZ2rgYYmjMG5uocsW+go0mZ6asoKAC AjFfFRvJjIf2cKvyFzM4M2p8QS04LdABCKklWIWhC+WgsXJUxyyM0x+v2kG0Pkq9imDz qUfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=qgIz8ZXqxR+qL3nvVcdKU+rwgX72c7Lhu1jYDVFQ+gU=; b=TWsnL4fxKXVsgPsJp3E4MLF+E4RbdephCZmKjxMfONpc6xHLRrsw0X7txazUJOLBko rRGPpcoc2jKKHYfLtSXKNYS1dkQm/1AxPYpmYYDjAwC7GHVT5yMeleKYvCdDoWxKcTCK Dq3KXaTjQjHor79G4h/tU/aaRbIC/c3z+ozHXBVXNOxC0PN8Y/vulicvvta56JuRbOZW dbEq/37c8uOQJGgaLWZv7H0bLjplY35y7muYTa99ftLJDfk3KvM5YGFmRUoxl8/7J5XV jG4xzSY1+E/fK0YVB3z18bYdDLwAGPTEaMY+YoM5jFn0xZ2hK5JRquADDIPmJ1sZUA8e 0HrQ== X-Gm-Message-State: ANhLgQ07xt4Hnm4S8STlFwSFFbaVnO1HvLeVDeaeZR4rhs0kMiIVGsbV u8wanMse6+iB4x4ItXetdwea0llKa6j2rMCEhA== X-Received: by 2002:a17:90a:9908:: with SMTP id b8mr912701pjp.93.1583834941368; Tue, 10 Mar 2020 03:09:01 -0700 (PDT) Date: Tue, 10 Mar 2020 18:08:52 +0800 Message-Id: <20200310180642.Bluez.v1.1.I50b301a0464eb68e3d62721bf59e11ed2617c415@changeid> Mime-Version: 1.0 X-Mailer: git-send-email 2.25.1.481.gfbce0eb801-goog Subject: [Bluez PATCH v1] Bluetooth: L2CAP: handle l2cap config request during open state From: Howard Chung To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org Cc: chromeos-bluetooth-upstreaming@chromium.org, Howard Chung , "David S. Miller" , Johan Hedberg , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jakub Kicinski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org According to Core Spec Version 5.2 | Vol 3, Part A 6.1.5, the incoming L2CAP_ConfigReq should be handled during OPEN state. Signed-off-by: Howard Chung --- net/bluetooth/l2cap_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 697c0f7f2c1a..5e6e35ab44dd 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -4300,7 +4300,8 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, return 0; } - if (chan->state != BT_CONFIG && chan->state != BT_CONNECT2) { + if (chan->state != BT_CONFIG && chan->state != BT_CONNECT2 && + chan->state != BT_CONNECTED) { cmd_reject_invalid_cid(conn, cmd->ident, chan->scid, chan->dcid); goto unlock; -- 2.25.1.481.gfbce0eb801-goog