summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_sock.c
diff options
context:
space:
mode:
authorMarcel Holtmann2013-10-14 11:45:34 +0200
committerJohan Hedberg2013-10-14 13:21:06 +0200
commitbdc257830760a784370ae4ab2d682b252b983e77 (patch)
treea74e5dd9b65b39310a6862146ebd9b74903004f7 /net/bluetooth/l2cap_sock.c
parentBluetooth: Adjust header for proc socket information (diff)
downloadkernel-qcow2-linux-bdc257830760a784370ae4ab2d682b252b983e77.tar.gz
kernel-qcow2-linux-bdc257830760a784370ae4ab2d682b252b983e77.tar.xz
kernel-qcow2-linux-bdc257830760a784370ae4ab2d682b252b983e77.zip
Bluetooth: Introduce L2CAP channel flag for defer setup
The L2CAP core should not look into the socket flags to figure out the setting of defer setup. So introduce a L2CAP channel flag that mirrors the socket flag. Since the defer setup option is only set in one place this becomes a really easy thing to do. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r--net/bluetooth/l2cap_sock.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index f1b462faf649..f5d957328545 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -672,10 +672,13 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
break;
}
- if (opt)
+ if (opt) {
set_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags);
- else
+ set_bit(FLAG_DEFER_SETUP, &chan->flags);
+ } else {
clear_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags);
+ clear_bit(FLAG_DEFER_SETUP, &chan->flags);
+ }
break;
case BT_FLUSHABLE: