From: johan.hedberg@gmail.com
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v3 6/8] Bluetooth: Fix sending responses to identified L2CAP response packets
Date: Sat, 14 Sep 2013 20:28:29 +0300 [thread overview]
Message-ID: <1379179711-16436-7-git-send-email-johan.hedberg@gmail.com> (raw)
In-Reply-To: <1379179711-16436-1-git-send-email-johan.hedberg@gmail.com>
From: Johan Hedberg <johan.hedberg@intel.com>
When L2CAP packets return a non-zero error and the value is passed
onwards by l2cap_bredr_sig_cmd this will trigger a command reject packet
to be sent. However, the core specification (page 1416 in core 4.0) says
the following: "Command Reject packets should not be sent in response to
an identified Response packet.".
This patch ensures that a command reject packet is not sent for any
identified response packet by ignoring the error return value from the
response handler functions.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
net/bluetooth/l2cap_core.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index d134501..7d36051 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -5212,7 +5212,7 @@ static inline int l2cap_bredr_sig_cmd(struct l2cap_conn *conn,
case L2CAP_CONN_RSP:
case L2CAP_CREATE_CHAN_RSP:
- err = l2cap_connect_create_rsp(conn, cmd, cmd_len, data);
+ l2cap_connect_create_rsp(conn, cmd, cmd_len, data);
break;
case L2CAP_CONF_REQ:
@@ -5220,7 +5220,7 @@ static inline int l2cap_bredr_sig_cmd(struct l2cap_conn *conn,
break;
case L2CAP_CONF_RSP:
- err = l2cap_config_rsp(conn, cmd, cmd_len, data);
+ l2cap_config_rsp(conn, cmd, cmd_len, data);
break;
case L2CAP_DISCONN_REQ:
@@ -5228,7 +5228,7 @@ static inline int l2cap_bredr_sig_cmd(struct l2cap_conn *conn,
break;
case L2CAP_DISCONN_RSP:
- err = l2cap_disconnect_rsp(conn, cmd, cmd_len, data);
+ l2cap_disconnect_rsp(conn, cmd, cmd_len, data);
break;
case L2CAP_ECHO_REQ:
@@ -5243,7 +5243,7 @@ static inline int l2cap_bredr_sig_cmd(struct l2cap_conn *conn,
break;
case L2CAP_INFO_RSP:
- err = l2cap_information_rsp(conn, cmd, cmd_len, data);
+ l2cap_information_rsp(conn, cmd, cmd_len, data);
break;
case L2CAP_CREATE_CHAN_REQ:
@@ -5255,7 +5255,7 @@ static inline int l2cap_bredr_sig_cmd(struct l2cap_conn *conn,
break;
case L2CAP_MOVE_CHAN_RSP:
- err = l2cap_move_channel_rsp(conn, cmd, cmd_len, data);
+ l2cap_move_channel_rsp(conn, cmd, cmd_len, data);
break;
case L2CAP_MOVE_CHAN_CFM:
@@ -5263,7 +5263,7 @@ static inline int l2cap_bredr_sig_cmd(struct l2cap_conn *conn,
break;
case L2CAP_MOVE_CHAN_CFM_RSP:
- err = l2cap_move_channel_confirm_rsp(conn, cmd, cmd_len, data);
+ l2cap_move_channel_confirm_rsp(conn, cmd, cmd_len, data);
break;
default:
--
1.8.4.rc3
next prev parent reply other threads:[~2013-09-14 17:28 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-14 17:28 [PATCH v3 0/8] Bluetooth: Various L2CAP fixes johan.hedberg
2013-09-14 17:28 ` [PATCH v3 1/8] Bluetooth: Remove unused event mask struct johan.hedberg
2013-09-15 1:47 ` Marcel Holtmann
2013-09-14 17:28 ` [PATCH v3 2/8] Bluetooth: Fix L2CAP command reject reason johan.hedberg
2013-09-15 1:52 ` Marcel Holtmann
2013-09-15 6:34 ` Johan Hedberg
2013-09-15 16:05 ` Marcel Holtmann
2013-09-14 17:28 ` [PATCH v3 3/8] Bluetooth: Fix double error response for l2cap_create_chan_req johan.hedberg
2013-09-14 17:28 ` [PATCH v3 4/8] Bluetooth: Fix L2CAP Disconnect response for unknown CID johan.hedberg
2013-09-14 17:28 ` [PATCH v3 5/8] Bluetooth: Fix error code for invalid CID in l2cap_config_req johan.hedberg
2013-09-15 1:49 ` Marcel Holtmann
2013-09-15 6:30 ` Johan Hedberg
2013-09-15 16:03 ` Marcel Holtmann
2013-09-15 18:15 ` Johan Hedberg
2013-09-15 19:04 ` Marcel Holtmann
2013-09-15 20:00 ` Johan Hedberg
2013-09-16 0:17 ` Marcel Holtmann
2013-09-16 9:54 ` Johan Hedberg
2013-09-14 17:28 ` johan.hedberg [this message]
2013-09-15 1:54 ` [PATCH v3 6/8] Bluetooth: Fix sending responses to identified L2CAP response packets Marcel Holtmann
2013-09-14 17:28 ` [PATCH v3 7/8] Bluetooth: Fix responding to invalid L2CAP signaling commands johan.hedberg
2013-09-14 17:28 ` [PATCH v3 8/8] Bluetooth: Fix waiting for clearing of BT_SK_SUSPEND flag johan.hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1379179711-16436-7-git-send-email-johan.hedberg@gmail.com \
--to=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).