From ece06026a549d49227cdd6d5f5d17c6eef3b277b Mon Sep 17 00:00:00 2001 From: emax Date: Thu, 2 Nov 2006 18:57:09 +0000 Subject: Properly htole16() PSM in sockaddr_l2cap MFC after: 3 days --- usr.sbin/bluetooth/bthidd/client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.sbin/bluetooth/bthidd') diff --git a/usr.sbin/bluetooth/bthidd/client.c b/usr.sbin/bluetooth/bthidd/client.c index ae06393..59f0d19 100644 --- a/usr.sbin/bluetooth/bthidd/client.c +++ b/usr.sbin/bluetooth/bthidd/client.c @@ -45,7 +45,7 @@ #include "bthid_config.h" #include "bthidd.h" -static int32_t client_socket(bdaddr_p bdaddr, int32_t psm); +static int32_t client_socket(bdaddr_p bdaddr, uint16_t psm); /* * Get next config entry and create outbound connection (if required) @@ -212,7 +212,7 @@ client_connect(bthid_server_p srv, int32_t fd) */ static int -client_socket(bdaddr_p bdaddr, int32_t psm) +client_socket(bdaddr_p bdaddr, uint16_t psm) { struct sockaddr_l2cap l2addr; int32_t s, m; @@ -243,7 +243,7 @@ client_socket(bdaddr_p bdaddr, int32_t psm) } memcpy(&l2addr.l2cap_bdaddr, bdaddr, sizeof(l2addr.l2cap_bdaddr)); - l2addr.l2cap_psm = psm; + l2addr.l2cap_psm = htole16(psm); if (connect(s, (struct sockaddr *) &l2addr, sizeof(l2addr)) < 0 && errno != EINPROGRESS) { -- cgit v1.1