linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH obexd 2/2] client: Fix not checking if GoepL2capPsm contains a valid PSM
Date: Tue, 15 May 2012 19:16:46 +0300	[thread overview]
Message-ID: <1337098606-5710-2-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1337098606-5710-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

In case the PSM is not valid ignore it so we are still able to connect
to RFCOMM.
---
 client/bluetooth.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/client/bluetooth.c b/client/bluetooth.c
index b49a82e..56f80fe 100644
--- a/client/bluetooth.c
+++ b/client/bluetooth.c
@@ -261,7 +261,8 @@ static void search_callback(uint8_t type, uint16_t status,
 		}
 
 		data = sdp_data_get(rec, 0x0200);
-		if (data != NULL)
+		/* PSM must be odd and lsb of upper byte must be 0 */
+		if (data != NULL && (data->val.uint16 & 0x0101) == 0x0001)
 			ch = data->val.uint16;
 
 		sdp_record_free(rec);
-- 
1.7.7.6


  reply	other threads:[~2012-05-15 16:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-15 16:16 [PATCH obexd 1/2] bluetooth: Fix not setting port to 0 when listen fails Luiz Augusto von Dentz
2012-05-15 16:16 ` Luiz Augusto von Dentz [this message]
2012-05-16  7:57 ` 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=1337098606-5710-2-git-send-email-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).