From: Gustavo F. Padovan Date: Tue, 8 Jun 2010 22:09:48 +0000 (-0300) Subject: Bluetooth: Disconnect the channel if we don't want the proposed mode X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=742e519b0db4a470008118b48f0baea6126e2122;p=deliverable%2Flinux.git Bluetooth: Disconnect the channel if we don't want the proposed mode If the device is a STATE 2 then it should disconnect the channel if the remote device propose a mode different from its mandatory mode. Signed-off-by: Gustavo F. Padovan Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index e78a7504d09c..03e9125dd74f 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c @@ -2617,8 +2617,9 @@ static int l2cap_parse_conf_req(struct sock *sk, void *data) break; } - if (!l2cap_mode_supported(pi->mode, pi->conn->feat_mask)) + if (pi->mode != rfc.mode) return -ECONNREFUSED; + break; default: pi->mode = l2cap_select_mode(rfc.mode, pi->conn->feat_mask);