public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: remove ERTM minimum packet length
@ 2010-06-09 19:46 Nathan Holstein
  2010-06-09 22:24 ` Gustavo F. Padovan
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Holstein @ 2010-06-09 19:46 UTC (permalink / raw)
  To: linux-bluetooth

ERTM and streaming mode L2CAP sockets have no minimum packet length.
Instead, validate the the packet contained all necessary control, FCS,
and SAR fields.

Signed-off-by: Nathan Holstein <ngh@isomerica.net>
---
 net/bluetooth/l2cap.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 411b1ec..9099e6d 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -4131,9 +4131,9 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
 {
 	struct sock *sk;
 	struct l2cap_pinfo *pi;
-	u16 control, len;
+	u16 control;
 	u8 tx_seq, req_seq;
-	int next_tx_seq_offset, req_seq_offset;
+	int len, next_tx_seq_offset, req_seq_offset;
 
 	sk = l2cap_get_chan_by_scid(&conn->chan_list, cid);
 	if (!sk) {
@@ -4203,7 +4203,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
 		}
 
 		if (__is_iframe(control)) {
-			if (len < 4) {
+			if (len < 0) {
 				l2cap_send_disconn_req(pi->conn, sk);
 				goto drop;
 			}
@@ -4234,7 +4234,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
 		if (pi->fcs == L2CAP_FCS_CRC16)
 			len -= 2;
 
-		if (len > pi->mps || len < 4 || __is_sframe(control))
+		if (len > pi->mps || len < 0 || __is_sframe(control))
 			goto drop;
 
 		tx_seq = __get_txseq(control);
-- 
1.6.0.4




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

* Re: [PATCH] Bluetooth: remove ERTM minimum packet length
  2010-06-09 19:46 [PATCH] Bluetooth: remove ERTM minimum packet length Nathan Holstein
@ 2010-06-09 22:24 ` Gustavo F. Padovan
  0 siblings, 0 replies; 2+ messages in thread
From: Gustavo F. Padovan @ 2010-06-09 22:24 UTC (permalink / raw)
  To: Nathan Holstein; +Cc: linux-bluetooth

Hi Nathan,

* Nathan Holstein <nathan@lampreynetworks.com> [2010-06-09 15:46:25 -0400]:

> ERTM and streaming mode L2CAP sockets have no minimum packet length.
> Instead, validate the the packet contained all necessary control, FCS,
> and SAR fields.
> 
> Signed-off-by: Nathan Holstein <ngh@isomerica.net>
> ---
>  net/bluetooth/l2cap.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 

Patch has been applied to the master branch of my tree. Thanks.

-- 
Gustavo F. Padovan
http://padovan.org

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

end of thread, other threads:[~2010-06-09 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-09 19:46 [PATCH] Bluetooth: remove ERTM minimum packet length Nathan Holstein
2010-06-09 22:24 ` Gustavo F. Padovan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox