Skip to contentSkip to conversation

Bluetooth: Print error when dropping L2CAP data

PATCH In review Szymon Janc 2 participants 2 messages Feb 18, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: Print error when dropping L2CAP data

Silently dropping L2CAP data (i.e. due to remote device not obeying negotiated MTU) is confusing and makes debugging harder.

---

I also wonder if kernel shouldn't just disconnect if data would be dropped. This is reliable connection after all...

 net/bluetooth/l2cap_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/bluetooth/l2cap_core.c +3 -1
index 6e6b3a9..7e0c51a 100644
@@ -6759,8 +6759,10 @@ static void l2cap_data_channel(struct l2cap_conn *conn, u16 cid,
 		 * But we don't have any other choice. L2CAP doesn't
 		 * provide flow control mechanism. */
 
-		if (chan->imtu < skb->len)
+		if (chan->imtu < skb->len) {
+			BT_ERR("Dropping L2CAP data: receive buffer overflow");
 			goto drop;
+		}
 
 		if (!chan->ops->recv(chan, skb))
 			goto done;
Signature · 1 line
1.9.0.rc3
maintainer
#1 lore raw

Hi Szymon,

Quoted 11 lines

Silently dropping L2CAP data (i.e. due to remote device not obeying negotiated MTU) is confusing and makes debugging harder.

---

I also wonder if kernel shouldn't just disconnect if data would be dropped. This is reliable connection after all...

net/bluetooth/l2cap_core.c | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel