]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Bluetooth: Reject LE CoC commands when the feature is not enabled
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 3 Dec 2013 07:51:51 +0000 (09:51 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 5 Dec 2013 15:05:34 +0000 (07:05 -0800)
Since LE CoC support needs to be enabled through a module option for now
we need to reject any related signaling PDUs in addition to rejecting
the creation of LE CoC sockets (which we already do).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/l2cap_core.c

index 8a0d235215cd36ae97ea3d4ec9a4be09350db6fb..aaa98a2318ca02ddef645c8156755ed30639ac33 100644 (file)
@@ -5597,6 +5597,17 @@ static inline int l2cap_le_sig_cmd(struct l2cap_conn *conn,
 {
        int err = 0;
 
+       if (!enable_lecoc) {
+               switch (cmd->code) {
+               case L2CAP_LE_CONN_REQ:
+               case L2CAP_LE_CONN_RSP:
+               case L2CAP_LE_CREDITS:
+               case L2CAP_DISCONN_REQ:
+               case L2CAP_DISCONN_RSP:
+                       return -EINVAL;
+               }
+       }
+
        switch (cmd->code) {
        case L2CAP_COMMAND_REJ:
                break;