diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-07 14:44:48 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2013-12-05 16:05:35 +0100 |
commit | 029727a39a4316c081347749d5c25f76d5eb891c (patch) | |
tree | 800d5ca871a647867c501ccfa8ab9bbc46fe5efe /net | |
parent | Bluetooth: Fix LE L2CAP Connect Request handling together with SMP (diff) | |
download | linux-029727a39a4316c081347749d5c25f76d5eb891c.tar.xz linux-029727a39a4316c081347749d5c25f76d5eb891c.zip |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 407e9d61d061..82aa6f352b20 100644 --- a/net/bluetooth/l2cap_core.c +++ b/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) |