All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH obexd 1/2] bluetooth: Fix not setting port to 0 when listen fails
@ 2012-05-15 16:16 Luiz Augusto von Dentz
  2012-05-15 16:16 ` [PATCH obexd 2/2] client: Fix not checking if GoepL2capPsm contains a valid PSM Luiz Augusto von Dentz
  2012-05-16  7:57 ` [PATCH obexd 1/2] bluetooth: Fix not setting port to 0 when listen fails Johan Hedberg
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2012-05-15 16:16 UTC (permalink / raw)
  To: linux-bluetooth

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

With some only kernels auto assigning psm seem to fail, leaving the psm
with wrong value:

obexd[2930]: plugins/bluetooth.c:start() listening on channel 9
obexd[2930]: bluetooth: unable to listen in psm 65535
obexd[2930]: plugins/bluetooth.c:start() listening on channel 10
obexd[2930]: bluetooth: unable to listen in psm 65535
---
 plugins/bluetooth.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
index aab50fd..79de9a2 100644
--- a/plugins/bluetooth.c
+++ b/plugins/bluetooth.c
@@ -607,6 +607,7 @@ static GSList *start(struct obex_server *server,
 		error("bluetooth: unable to listen in psm %d: %s",
 				service->port, err->message);
 		g_error_free(err);
+		service->port = 0;
 	} else {
 		l = g_slist_prepend(l, io);
 		bt_io_get(io, BT_IO_L2CAP, &err, BT_IO_OPT_PSM, &service->port,
-- 
1.7.7.6


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

* [PATCH obexd 2/2] client: Fix not checking if GoepL2capPsm contains a valid PSM
  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
  2012-05-16  7:57 ` [PATCH obexd 1/2] bluetooth: Fix not setting port to 0 when listen fails Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2012-05-15 16:16 UTC (permalink / raw)
  To: linux-bluetooth

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


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

* Re: [PATCH obexd 1/2] bluetooth: Fix not setting port to 0 when listen fails
  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 ` [PATCH obexd 2/2] client: Fix not checking if GoepL2capPsm contains a valid PSM Luiz Augusto von Dentz
@ 2012-05-16  7:57 ` Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2012-05-16  7:57 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

On Tue, May 15, 2012, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> With some only kernels auto assigning psm seem to fail, leaving the psm
> with wrong value:
> 
> obexd[2930]: plugins/bluetooth.c:start() listening on channel 9
> obexd[2930]: bluetooth: unable to listen in psm 65535
> obexd[2930]: plugins/bluetooth.c:start() listening on channel 10
> obexd[2930]: bluetooth: unable to listen in psm 65535
> ---
>  plugins/bluetooth.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

Both patches have been applied. Thanks.

Johan

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

end of thread, other threads:[~2012-05-16  7:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH obexd 2/2] client: Fix not checking if GoepL2capPsm contains a valid PSM Luiz Augusto von Dentz
2012-05-16  7:57 ` [PATCH obexd 1/2] bluetooth: Fix not setting port to 0 when listen fails Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.