Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f59ddad authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg
Browse files

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: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent a74a84f6
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -77,7 +77,7 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
		if (la.l2_psm)
		if (la.l2_psm)
			return -EINVAL;
			return -EINVAL;
		/* We only allow ATT user space socket */
		/* 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;
			return -EINVAL;
	}
	}


@@ -170,7 +170,7 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr,
		if (la.l2_psm)
		if (la.l2_psm)
			return -EINVAL;
			return -EINVAL;
		/* We only allow ATT user space socket */
		/* 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;
			return -EINVAL;
	}
	}