Commit 6e4aff10 authored by Santosh Nayak's avatar Santosh Nayak Committed by Gustavo Padovan

Bluetooth: Fix Endian Bug.

Fix network to host endian conversion for L2CAP chan id.
Signed-off-by: default avatarSantosh Nayak <santoshprasadnayak@gmail.com>
Acked-by: default avatarAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent 3f17790c
...@@ -82,7 +82,7 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) ...@@ -82,7 +82,7 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
} }
if (la.l2_cid) if (la.l2_cid)
err = l2cap_add_scid(chan, la.l2_cid); err = l2cap_add_scid(chan, __le16_to_cpu(la.l2_cid));
else else
err = l2cap_add_psm(chan, &la.l2_bdaddr, la.l2_psm); err = l2cap_add_psm(chan, &la.l2_bdaddr, la.l2_psm);
...@@ -123,7 +123,8 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int al ...@@ -123,7 +123,8 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int al
if (la.l2_cid && la.l2_psm) if (la.l2_cid && la.l2_psm)
return -EINVAL; return -EINVAL;
err = l2cap_chan_connect(chan, la.l2_psm, la.l2_cid, &la.l2_bdaddr); err = l2cap_chan_connect(chan, la.l2_psm, __le16_to_cpu(la.l2_cid),
&la.l2_bdaddr);
if (err) if (err)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment