Browse Source

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.

Signed-off-by: Szymon Janc <szymon.janc@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Szymon Janc 11 years ago
parent
commit
2c96e03def
1 changed files with 3 additions and 1 deletions
  1. 3 1
      net/bluetooth/l2cap_core.c

+ 3 - 1
net/bluetooth/l2cap_core.c

@@ -6776,8 +6776,10 @@ static void l2cap_data_channel(struct l2cap_conn *conn, u16 cid,
 		 * But we don't have any other choice. L2CAP doesn't
 		 * But we don't have any other choice. L2CAP doesn't
 		 * provide flow control mechanism. */
 		 * provide flow control mechanism. */
 
 
-		if (chan->imtu < skb->len)
+		if (chan->imtu < skb->len) {
+			BT_ERR("Dropping L2CAP data: receive buffer overflow");
 			goto drop;
 			goto drop;
+		}
 
 
 		if (!chan->ops->recv(chan, skb))
 		if (!chan->ops->recv(chan, skb))
 			goto done;
 			goto done;