Explorar el Código

Bluetooth: Fix disconnecting L2CAP channel for credits violation

The L2CAP specification requires us to disconnect a channel if the
remote device sends us data when it doesn't have any credits to do so.
This patch makes sure that we send the appropriate L2CAP Disconnect
request in this situation.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Johan Hedberg hace 12 años
padre
commit
dfd9774c5a
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      net/bluetooth/l2cap_core.c

+ 1 - 0
net/bluetooth/l2cap_core.c

@@ -6635,6 +6635,7 @@ static int l2cap_le_data_rcv(struct l2cap_chan *chan, struct sk_buff *skb)
 
 
 	if (!chan->rx_credits) {
 	if (!chan->rx_credits) {
 		BT_ERR("No credits to receive LE L2CAP data");
 		BT_ERR("No credits to receive LE L2CAP data");
+		l2cap_send_disconn_req(chan, ECONNRESET);
 		return -ENOBUFS;
 		return -ENOBUFS;
 	}
 	}