aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-10-16 12:31:17 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2013-10-16 12:52:51 -0400
commit7f59ddada192583aee81ebf0de4cdc5a94642915 (patch)
tree3c2c3d4655f6c4aaf54f18ca9acce9092743bcc7
parenta74a84f696537f38fa994c1b95a0dca9ae386865 (diff)
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>
-rw-r--r--net/bluetooth/l2cap_sock.c4
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)
77 if (la.l2_psm) 77 if (la.l2_psm)
78 return -EINVAL; 78 return -EINVAL;
79 /* We only allow ATT user space socket */ 79 /* We only allow ATT user space socket */
80 if (la.l2_cid != L2CAP_CID_ATT) 80 if (la.l2_cid != __constant_cpu_to_le16(L2CAP_CID_ATT))
81 return -EINVAL; 81 return -EINVAL;
82 } 82 }
83 83
@@ -170,7 +170,7 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr,
170 if (la.l2_psm) 170 if (la.l2_psm)
171 return -EINVAL; 171 return -EINVAL;
172 /* We only allow ATT user space socket */ 172 /* We only allow ATT user space socket */
173 if (la.l2_cid != L2CAP_CID_ATT) 173 if (la.l2_cid != __constant_cpu_to_le16(L2CAP_CID_ATT))
174 return -EINVAL; 174 return -EINVAL;
175 } 175 }
176 176