summaryrefslogtreecommitdiff
path: root/net/bluetooth/l2cap_sock.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-01-26 02:10:09 +0400
committerJohan Hedberg <johan.hedberg@intel.com>2014-02-13 11:51:37 +0400
commit7a8e5a31ecd50ace4fce57304c8fdd206f013fde (patch)
tree67ed961eef036b7ba6ad6a9bec7957ae70e7a49d /net/bluetooth/l2cap_sock.c
parente0c888ad739513b9baae5c25e85dd6490595e5be (diff)
downloadlinux-7a8e5a31ecd50ace4fce57304c8fdd206f013fde.tar.xz
Bluetooth: Fix CID initialization for fixed channels
Fixed channels have the same source and destination CID. Ensure that the values get properly initialized when receiving incoming connections and deriving values from the parent socket. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r--net/bluetooth/l2cap_sock.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 7ad346ea06ed..ae4f6b593fc0 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1470,6 +1470,11 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
chan->tx_credits = pchan->tx_credits;
chan->rx_credits = pchan->rx_credits;
+ if (chan->chan_type == L2CAP_CHAN_FIXED) {
+ chan->scid = pchan->scid;
+ chan->dcid = pchan->scid;
+ }
+
security_sk_clone(parent, sk);
} else {
switch (sk->sk_type) {