summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg2013-12-03 08:51:51 +0100
committerMarcel Holtmann2013-12-05 16:05:34 +0100
commit3af8ace653c83c663d4b97c6ea7f01463d366bf9 (patch)
treea7e4ff16deb9b1a98f073b50eb653011ed736def
parentBluetooth: Add LE flow control discipline (diff)
downloadkernel-qcow2-linux-3af8ace653c83c663d4b97c6ea7f01463d366bf9.tar.gz
kernel-qcow2-linux-3af8ace653c83c663d4b97c6ea7f01463d366bf9.tar.xz
kernel-qcow2-linux-3af8ace653c83c663d4b97c6ea7f01463d366bf9.zip
Bluetooth: Reject LE CoC commands when the feature is not enabled
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>
-rw-r--r--net/bluetooth/l2cap_core.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 8a0d235215cd..aaa98a2318ca 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -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;