mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
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>
This commit is contained in:
parent
a74a84f696
commit
7f59ddada1
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue