diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2013-10-16 09:31:17 -0700 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-16 19:52:51 +0300 |
commit | 7f59ddada192583aee81ebf0de4cdc5a94642915 (patch) | |
tree | 3c2c3d4655f6c4aaf54f18ca9acce9092743bcc7 /net | |
parent | a74a84f696537f38fa994c1b95a0dca9ae386865 (diff) | |
download | linux-7f59ddada192583aee81ebf0de4cdc5a94642915.tar.gz linux-7f59ddada192583aee81ebf0de4cdc5a94642915.tar.bz2 linux-7f59ddada192583aee81ebf0de4cdc5a94642915.zip |
Bluetooth: Socket address parameter for CID is in little endian
The L2CAP socket parameter for CID are actually provided in little
endian. So convert our constants into little endian before comparing
them.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 95498d553b00..34e5a58ffca8 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -77,7 +77,7 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) if (la.l2_psm) return -EINVAL; /* We only allow ATT user space socket */ - if (la.l2_cid != L2CAP_CID_ATT) + if (la.l2_cid != __constant_cpu_to_le16(L2CAP_CID_ATT)) return -EINVAL; } @@ -170,7 +170,7 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, if (la.l2_psm) return -EINVAL; /* We only allow ATT user space socket */ - if (la.l2_cid != L2CAP_CID_ATT) + if (la.l2_cid != __constant_cpu_to_le16(L2CAP_CID_ATT)) return -EINVAL; } |