From: Johan Hedberg <johan.hedberg@gmail.com>
To: Santiago Carot <sancane@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Fix byte order problems getting PSM through btio API
Date: Wed, 30 Nov 2011 23:16:00 +0200 [thread overview]
Message-ID: <20111130211600.GA9230@fusion.localdomain> (raw)
In-Reply-To: <CACLukzJWL5=w59ARvwKvz+_Q81=ZJ+4qj_tU0+AxmT4g6847Sw@mail.gmail.com>
Hi Santiago,
On Wed, Nov 30, 2011, Santiago Carot wrote:
> 2011/11/30 Santiago Carot-Nemesio <sancane@gmail.com>:
> > ---
> > btio/btio.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/btio/btio.c b/btio/btio.c
> > index a129bf9..f8c5cc7 100644
> > --- a/btio/btio.c
> > +++ b/btio/btio.c
> > @@ -882,7 +882,7 @@ static gboolean l2cap_get(int sock, GError **err, BtIOOption opt1,
> > break;
> > case BT_IO_OPT_PSM:
> > *(va_arg(args, uint16_t *)) = src.l2_psm ?
> > - src.l2_psm : dst.l2_psm;
> > + btohs(src.l2_psm) : btohs(dst.l2_psm);
> > break;
> > case BT_IO_OPT_CID:
> > *(va_arg(args, uint16_t *)) = src.l2_cid ?
> > --
> > 1.7.7.4
> >
>
> At a first sight, It seems there may be the same problems retrieving
> CID, OMTU and IMTU on big endian architectures. I preffer waiting for
> a more experienced comments before sending any patch fixing that.
To my understanding the L2CAP PSM is the only parameter that uses
protocol endianess in the socket interface, so we should be safe with
the other values.
Johan
next prev parent reply other threads:[~2011-11-30 21:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-30 16:36 [PATCH] Fix byte order problems getting PSM through btio API Santiago Carot-Nemesio
2011-11-30 16:44 ` Santiago Carot
2011-11-30 21:16 ` Johan Hedberg [this message]
2011-12-01 19:31 ` Santiago Carot
2011-12-01 20:34 ` Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111130211600.GA9230@fusion.localdomain \
--to=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=sancane@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox