1
0
Fork 0

Bluetooth: Check the tx_window size on setsockopt

We have to check if the proposed tx_window value is not greater that
maximum value supported.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
hifive-unleashed-5.1
Gustavo F. Padovan 2010-06-07 19:21:30 -03:00 committed by Marcel Holtmann
parent 3cb123d1c0
commit 45d65c46ac
1 changed files with 5 additions and 0 deletions

View File

@ -1912,6 +1912,11 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us
break;
}
if (opts.txwin_size > L2CAP_DEFAULT_TX_WINDOW) {
err = -EINVAL;
break;
}
l2cap_pi(sk)->mode = opts.mode;
switch (l2cap_pi(sk)->mode) {
case L2CAP_MODE_BASIC: