mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
Bluetooth: L2CAP: Use default TxWindow for zero socket option
L2CAP_OPTIONS accepts a txwin_size of zero and
stores it in tx_win. The zero is then sent to the
peer in our configuration request, and if the
channel ends up in ERTM mode it is passed to
l2cap_seq_list_init().
Use the default TxWindow instead, as the mode can
still be changed to ERTM during configuration.
Fixes: 14b5aa71ec ("Bluetooth: Add sockopt configuration for txWindow on L2CAP")
Cc: stable@vger.kernel.org
Signed-off-by: Siwei Zhang <oss@fourdim.xyz>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
c5ebb0245f
commit
226fa3b676
|
|
@ -815,6 +815,10 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname,
|
|||
break;
|
||||
}
|
||||
|
||||
/* A zero TxWindow is invalid, use the default instead */
|
||||
if (!opts.txwin_size)
|
||||
opts.txwin_size = L2CAP_DEFAULT_TX_WINDOW;
|
||||
|
||||
if (!l2cap_valid_mtu(chan, opts.imtu)) {
|
||||
err = -EINVAL;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user