diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2010-10-04 19:28:52 -0300 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2010-10-04 19:28:52 -0300 |
commit | eaa71b318c5ed0cd1ac3182a533471dc5edf372d (patch) | |
tree | 2e6b3cf97970543070334e90b4b2300b04f460d2 /net | |
parent | e454c844644683571617896ab2a4ce0109c1943e (diff) | |
download | talos-obmc-linux-eaa71b318c5ed0cd1ac3182a533471dc5edf372d.tar.gz talos-obmc-linux-eaa71b318c5ed0cd1ac3182a533471dc5edf372d.zip |
Bluetooth: Disallow to change L2CAP_OPTIONS values when connected
L2CAP doesn't permit change like MTU, FCS, TxWindow values while the
connection is alive, we can only set that before the
connection/configuration process. That can lead to bugs in the L2CAP
operation.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/l2cap.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 44a8fb0d6c29..0b54b7dd8401 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c @@ -1950,6 +1950,11 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us switch (optname) { case L2CAP_OPTIONS: + if (sk->sk_state == BT_CONNECTED) { + err = -EINVAL; + break; + } + opts.imtu = l2cap_pi(sk)->imtu; opts.omtu = l2cap_pi(sk)->omtu; opts.flush_to = l2cap_pi(sk)->flush_to; |