linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "michal.lowas-rzechonek@silvair.com"  <michal.lowas-rzechonek@silvair.com>
To: "Gix, Brian" <brian.gix@intel.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH BlueZ] mesh: Fix IV Recovery procedure when IV Update is in progress
Date: Fri, 6 Sep 2019 09:07:06 +0200	[thread overview]
Message-ID: <20190906070706.xtfu7ihivlsyqvn2@mlowasrzechonek2133> (raw)
In-Reply-To: <3980d0c20d416de8ca17bd406cc830b03a4d9498.camel@intel.com>

Brian,

On 09/05, Gix, Brian wrote:
> >  	if (net->iv_upd_state == IV_UPD_INIT) {
> > -		if (iv_index > net->iv_index)
> > +		if (iv_index > net->iv_index + 1)
> >  			mesh_net_set_seq_num(net, 0);
> 
> I think you have found something, but I think we are missing something here...
> 
> If iv_index > net->iv_index, and iv_update == false, then we still
> want to reset to Seq Zero, I think...Even if the increase is just 1.

Indeed. Let me re-test both scenarios and I'll get back to you with v2.

> So perhaps:
> 	if (iv_index > net->iv_index && !iv_update)
> 		mesh_net_set_seq_num(net, 0);
> 	else if (iv_index > net->iv_index + 2)
> 		mesh_net_set_seq_num(net, 0);
> 
> Or more esoterically (and maybe harder to follow):
> 	if (iv_index > net->iv_index + iv_update)
> 		mesh_net_set_seq_num(net, 0);
> 
> Or something like that.

Yeah, that looks reasonable.

-- 
Michał Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
Silvair http://silvair.com
Jasnogórska 44, 31-358 Krakow, POLAND

      reply	other threads:[~2019-09-06  7:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05 13:12 [PATCH BlueZ] mesh: Fix IV Recovery procedure when IV Update is in progress Michał Lowas-Rzechonek
2019-09-05 21:43 ` Gix, Brian
2019-09-06  7:07   ` michal.lowas-rzechonek [this message]

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=20190906070706.xtfu7ihivlsyqvn2@mlowasrzechonek2133 \
    --to=michal.lowas-rzechonek@silvair.com \
    --cc=brian.gix@intel.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).