linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btio: Fix byte order conversion when getting L2CAP CID
@ 2011-12-05 11:54 Santiago Carot-Nemesio
  2011-12-08 12:23 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Santiago Carot-Nemesio @ 2011-12-05 11:54 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Santiago Carot-Nemesio

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 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/btio/btio.c b/btio/btio.c
index f8c5cc7..0d177a3 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;
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-08 12:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-05 11:54 [PATCH] btio: Fix byte order conversion when getting L2CAP CID Santiago Carot-Nemesio
2011-12-08 12:23 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).