Skip to contentSkip to conversation

endianness bug: missing cpu_to_le16() in l2cap

PATCH In review Al Viro 1 participant 1 message Oct 15, 2006 Bluetooth

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 2/4 endianness bug: missing cpu_to_le16() in l2cap

__l2cap_get_sock_by_addr() expects its first argument in little-endian.

---
 net/bluetooth/l2cap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/bluetooth/l2cap.c +1 -1
index 0995420..07d13a8 100644
@@ -741,7 +741,7 @@ static int l2cap_sock_listen(struct sock
 		write_lock_bh(&l2cap_sk_list.lock);
 
 		for (psm = 0x1001; psm < 0x1100; psm += 2)
-			if (!__l2cap_get_sock_by_addr(psm, src)) {
+			if (!__l2cap_get_sock_by_addr(htobs(psm), src)) {
 				l2cap_pi(sk)->psm   = htobs(psm);
 				l2cap_pi(sk)->sport = htobs(psm);
 				err = 0;
Signature · 1 line
1.4.2.GIT