From patchwork Sat Jul 16 04:30:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo F. Padovan" X-Patchwork-Id: 104930 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 7908BB6F77 for ; Sat, 16 Jul 2011 14:31:18 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751390Ab1GPEbG (ORCPT ); Sat, 16 Jul 2011 00:31:06 -0400 Received: from mail-qy0-f174.google.com ([209.85.216.174]:64412 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751110Ab1GPEbD (ORCPT ); Sat, 16 Jul 2011 00:31:03 -0400 Received: by mail-qy0-f174.google.com with SMTP id 29so709519qyk.19 for ; Fri, 15 Jul 2011 21:31:02 -0700 (PDT) Received: by 10.224.198.201 with SMTP id ep9mr3567407qab.126.1310790662252; Fri, 15 Jul 2011 21:31:02 -0700 (PDT) Received: from localhost.localdomain ([187.106.45.62]) by mx.google.com with ESMTPS id o4sm1308165qct.25.2011.07.15.21.30.59 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 15 Jul 2011 21:31:01 -0700 (PDT) From: "Gustavo F. Padovan" To: davem@davemloft.net Cc: linville@tuxdriver.com, netdev@vger.kernel.org, linux-bluetooth@vger.kernel.org, "Gustavo F. Padovan" Subject: [PATCH 1/2] Bluetooth: Fix regression in L2CAP connection procedure Date: Sat, 16 Jul 2011 01:30:20 -0300 Message-Id: <1310790621-28510-2-git-send-email-padovan@profusion.mobi> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1310790621-28510-1-git-send-email-padovan@profusion.mobi> References: <1310790621-28510-1-git-send-email-padovan@profusion.mobi> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: "Gustavo F. Padovan" Caused by the following commit, partially revert it. commit 9fa7e4f76f3658ba1f44fbdb95c77e7df3f53f95 Author: Gustavo F. Padovan Date: Thu Jun 30 16:11:30 2011 -0300 Bluetooth: Fix regression with incoming L2CAP connections PTS test A2DP/SRC/SRC_SET/TC_SRC_SET_BV_02_I revealed that ( probably after the df3c3931e commit ) the l2cap connection could not be established in case when the "Auth Complete" HCI event does not arive before the initiator send "Configuration request", in which case l2cap replies with "Command rejected" since the channel is still in BT_CONNECT2 state. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Gustavo F. Padovan --- net/bluetooth/l2cap_core.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index ebff14c..4fbf67e 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -2323,8 +2323,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr sk = chan->sk; - if ((bt_sk(sk)->defer_setup && sk->sk_state != BT_CONNECT2) || - (!bt_sk(sk)->defer_setup && sk->sk_state != BT_CONFIG)) { + if (sk->sk_state != BT_CONFIG && sk->sk_state != BT_CONNECT2) { struct l2cap_cmd_rej rej; rej.reason = cpu_to_le16(0x0002);