LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [Bluez PATCH v1] Bluetooth: L2CAP: handle l2cap config request during open state
@ 2020-03-10 10:08 Howard Chung
  2020-03-11 14:50 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: Howard Chung @ 2020-03-10 10:08 UTC (permalink / raw)
  To: linux-bluetooth, marcel
  Cc: chromeos-bluetooth-upstreaming, Howard Chung, David S. Miller,
	Johan Hedberg, netdev, linux-kernel, Jakub Kicinski

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 <howardchung@google.com>

---

 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bluez PATCH v1] Bluetooth: L2CAP: handle l2cap config request during open state
  2020-03-10 10:08 [Bluez PATCH v1] Bluetooth: L2CAP: handle l2cap config request during open state Howard Chung
@ 2020-03-11 14:50 ` Marcel Holtmann
  2020-03-11 14:50   ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2020-03-11 14:50 UTC (permalink / raw)
  To: Howard Chung
  Cc: Bluez mailing list, ChromeOS Bluetooth Upstreaming,
	David S. Miller, Johan Hedberg, netdev, linux-kernel,
	Jakub Kicinski

Hi Howard,

> 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 <howardchung@google.com>
> 
> ---
> 
> 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;

Any chance you can add a btmon trace excerpt for this to the commit message. It would be good to have the before and after here included.

Regards

Marcel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bluez PATCH v1] Bluetooth: L2CAP: handle l2cap config request during open state
  2020-03-11 14:50 ` Marcel Holtmann
@ 2020-03-11 14:50   ` Marcel Holtmann
  0 siblings, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2020-03-11 14:50 UTC (permalink / raw)
  To: Howard Chung
  Cc: Bluez mailing list, ChromeOS Bluetooth Upstreaming,
	David S. Miller, Johan Hedberg, netdev, linux-kernel,
	Jakub Kicinski

Hi Howard,

> 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 <howardchung@google.com>
> 
> ---
> 
> 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;

Any chance you can add a btmon trace excerpt for this to the commit message. It would be good to have the before and after here included.

Regards

Marcel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-11 14:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 10:08 [Bluez PATCH v1] Bluetooth: L2CAP: handle l2cap config request during open state Howard Chung
2020-03-11 14:50 ` Marcel Holtmann
2020-03-11 14:50   ` Marcel Holtmann

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).