public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrei Emeltchenko <andrei.emeltchenko.news@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/2] Bluetooth: Add support for encryption key refresh
Date: Thu, 7 Jun 2012 10:25:52 +0300	[thread overview]
Message-ID: <20120607072550.GE32366@aemeltch-MOBL1> (raw)
In-Reply-To: <20120607071414.GA12091@x220>

Hi Johan,

On Thu, Jun 07, 2012 at 03:14:14PM +0800, Johan Hedberg wrote:
> On Thu, Jun 07, 2012, Andrei Emeltchenko wrote:
> > > +	if (conn->state == BT_CONFIG) {
> > > +		if (!ev->status)
> > > +			conn->state = BT_CONNECTED;
> > > +
> > > +		hci_proto_connect_cfm(conn, ev->status);
> > > +		hci_conn_put(conn);
> > > +	} else {
> > > +		hci_auth_cfm(conn, ev->status);
> > > +
> > > +		hci_conn_hold(conn);
> > 
> > If you want to keep extra hold(conn) you may just not put. Is this typo?
> > 
> > > +		conn->disc_timeout = HCI_DISCONN_TIMEOUT;
> > > +		hci_conn_put(conn);
> > > +	}
> 
> This is just copy-paste from hci_auth_complete_evt(). I think the
> intention of the hold+put is to restart or remove the disconnect timer
> with the new disc_timeout value or something similar. If the code above
> needs fixing then so does the code in hci_auth_complete_evt().

OK. Got it. Seems that cancel_delayed_work(&conn->disc_work); is enough
here.

Best regards 
Andrei Emeltchenko 


  reply	other threads:[~2012-06-07  7:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-07  6:58 [PATCH 0/2] Bluetooth: Fix SMP support for encryption key refresh Johan Hedberg
2012-06-07  6:58 ` [PATCH 1/2] Bluetooth: Fix SMP security elevation from medium to high Johan Hedberg
2012-06-08  7:19   ` Gustavo Padovan
2012-06-07  6:58 ` [PATCH 2/2] Bluetooth: Add support for encryption key refresh Johan Hedberg
2012-06-07  7:07   ` Andrei Emeltchenko
2012-06-07  7:14     ` Johan Hedberg
2012-06-07  7:25       ` Andrei Emeltchenko [this message]
2012-06-08  7:20   ` Gustavo Padovan
2012-06-08 15:31     ` [PATCH v2] " Johan Hedberg
2012-06-09  0:12       ` Gustavo Padovan

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=20120607072550.GE32366@aemeltch-MOBL1 \
    --to=andrei.emeltchenko.news@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