From 14803c4e4fafbce64b00e56926b0eb0092fdd12f Mon Sep 17 00:00:00 2001 From: Santiago Carot-Nemesio Date: Mon, 5 Dec 2011 12:54:45 +0100 Subject: [PATCH] btio: Fix byte order conversion when getting L2CAP CID The L2CAP CID is passed and received in little endian byte order through the socket interface so a conversion is in place before passing it onwards. --- btio/btio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btio/btio.c b/btio/btio.c index f8c5cc70d..0d177a3ab 100644 --- a/btio/btio.c +++ b/btio/btio.c @@ -886,7 +886,7 @@ static gboolean l2cap_get(int sock, GError **err, BtIOOption opt1, break; case BT_IO_OPT_CID: *(va_arg(args, uint16_t *)) = src.l2_cid ? - src.l2_cid : dst.l2_cid; + btohs(src.l2_cid) : btohs(dst.l2_cid); break; case BT_IO_OPT_OMTU: *(va_arg(args, uint16_t *)) = l2o.omtu; -- 2.47.3