Bluetooth: Disconnect the channel if we don't want the proposed mode
authorGustavo F. Padovan <padovan@profusion.mobi>
Tue, 8 Jun 2010 22:09:48 +0000 (19:09 -0300)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 21 Jul 2010 17:39:08 +0000 (10:39 -0700)
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 <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/l2cap.c

index e78a7504d09cefffffec47bd309a587e9c85c1e4..03e9125dd74fd13581113e8bd71f80a1b1365129 100644 (file)
@@ -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);