浏览代码

Bluetooth: Fix suspending the L2CAP socket if we start with 0 credits

If the peer gives us zero credits in its connection request or response
we must call the suspend channel callback so the BT_SK_SUSPEND flag gets
set and user space is blocked from sending data to the socket.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Johan Hedberg 12 年之前
父节点
当前提交
029727a39a
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      net/bluetooth/l2cap_core.c

+ 3 - 0
net/bluetooth/l2cap_core.c

@@ -1202,6 +1202,9 @@ static void l2cap_le_flowctl_start(struct l2cap_chan *chan)
 	chan->sdu_len = 0;
 
 	skb_queue_head_init(&chan->tx_q);
+
+	if (!chan->tx_credits)
+		chan->ops->suspend(chan);
 }
 
 static void l2cap_chan_ready(struct l2cap_chan *chan)