linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: "Frédéric Danis" <frederic.danis@linux.intel.com>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] sdp: Prevent duplicate records registration
Date: Fri, 29 Jun 2012 16:35:05 +0300	[thread overview]
Message-ID: <20120629133505.GC27007@x220> (raw)
In-Reply-To: <CABBYNZLatbQeMHtaBcXRpFVs4HfWZsUmi36MU9MKw2TQYjemZw@mail.gmail.com>

Hi Luiz,

On Thu, Jun 21, 2012, Luiz Augusto von Dentz wrote:
> On Wed, Jun 20, 2012 at 12:35 PM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> 
> > Also, the RFCOMM server socket code in the kernel should already give an
> > error if binding to the same channel is attempted twice, so this would
> > look like a bug in one of the DUN implementations that they do not
> > unregister their service record when binding the server socket fails. So
> > simply fixing this bug would also make sure that two service records
> > aren't present (though it would remove the existence of the clueless
> > admin ;)
> 
> Good point, and should actually work for L2CAP as well, apparently
> __rfcomm_get_sock_by_addr don't check BDADDR_ANY:
> 
> 		if (rfcomm_pi(sk)->channel == channel &&
> 				!bacmp(&bt_sk(sk)->src, src))
> 			break;
> 
> So the question is, should we check in every adapter if there is
> listen socket for the given channel?

I think the kernel should return an error is bind is tried with
BDADDR_ANY more than once for the same PSM or RFCOMM channel.

> This complicates a little bit more the code, the other option is to
> oFono don't do the socket management itself, this might be possible
> with org.bluez.Telephony, so just register an agent for DUN as it will
> be for HFP, bluetoothd takes care of handling the connection and
> authorization and when its done

Isn't that exactly what the last two patches (for DUN and SAP) from the
telephony patch set do?

Johan

  reply	other threads:[~2012-06-29 13:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-20  9:02 [PATCH] sdp: Prevent duplicate records registration Frédéric Danis
2012-06-20  9:35 ` Johan Hedberg
2012-06-20 13:09   ` Frederic Danis
2012-06-21  8:36   ` Luiz Augusto von Dentz
2012-06-29 13:35     ` Johan Hedberg [this message]
2012-06-29 13:43       ` Luiz Augusto von Dentz
2012-06-29 13:52         ` Frederic Danis

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=20120629133505.GC27007@x220 \
    --to=johan.hedberg@gmail.com \
    --cc=frederic.danis@linux.intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@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;
as well as URLs for NNTP newsgroup(s).