提交 45d65c46 编写于 作者: G Gustavo F. Padovan 提交者: Marcel Holtmann

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: NGustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: NJoão Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 3cb123d1
...@@ -1912,6 +1912,11 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us ...@@ -1912,6 +1912,11 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us
break; break;
} }
if (opts.txwin_size > L2CAP_DEFAULT_TX_WINDOW) {
err = -EINVAL;
break;
}
l2cap_pi(sk)->mode = opts.mode; l2cap_pi(sk)->mode = opts.mode;
switch (l2cap_pi(sk)->mode) { switch (l2cap_pi(sk)->mode) {
case L2CAP_MODE_BASIC: case L2CAP_MODE_BASIC:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册