linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gix, Brian" <brian.gix@intel.com>
To: "michal.lowas-rzechonek@silvair.com" 
	<michal.lowas-rzechonek@silvair.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH BlueZ] mesh: Fix exiting IV_UPD_STATE when receiving first SNB
Date: Tue, 14 Jan 2020 14:40:42 +0000	[thread overview]
Message-ID: <4d564a2af113af28b39b947900c50e8a8dd11d9b.camel@intel.com> (raw)
In-Reply-To: <20200109125859.5389-1-michal.lowas-rzechonek@silvair.com>

Applied
On Thu, 2020-01-09 at 13:58 +0100, Michał Lowas-Rzechonek wrote:
> First valid SNB received from the network should cause the node to
> switch into IV_UPD_NORMAL state.
> 
> Otherwise, it will never try to enter IV Update procedure when sequence
> number approaches the IV_UPDATE_SEQ_TRIGGER, because that's only allowed
> in IV_UPD_NORMAL.
> ---
>  mesh/net.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/mesh/net.c b/mesh/net.c
> index 20e9a1e81..bd8826b58 100644
> --- a/mesh/net.c
> +++ b/mesh/net.c
> @@ -2688,11 +2688,17 @@ static void process_beacon(void *net_ptr, void *user_data)
>  	/* We have officially *seen* this beacon now */
>  	beacon_data->processed = true;
>  
> -	if (ivi == net->iv_index && ivu == net->iv_update && kr == local_kr)
> -		return;
> +	/*
> +	 * Ignore the beacon if it doesn't change anything, unless we're
> +	 * doing IV Recovery
> +	 */
> +	if (net->iv_upd_state == IV_UPD_INIT ||
> +				ivi != net->iv_index || ivu != net->iv_update)
> +		update_iv_ivu_state(net, ivi, ivu);
> +
> +	if (kr != local_kr)
> +		update_kr_state(subnet, kr, beacon_data->key_id);
>  
> -	update_iv_ivu_state(net, ivi, ivu);
> -	update_kr_state(subnet, kr, beacon_data->key_id);
>  	net_key_beacon_refresh(beacon_data->key_id, net->iv_index,
>  		!!(subnet->kr_phase == KEY_REFRESH_PHASE_TWO), net->iv_update);
>  }

      reply	other threads:[~2020-01-14 14:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09 12:58 [PATCH BlueZ] mesh: Fix exiting IV_UPD_STATE when receiving first SNB Michał Lowas-Rzechonek
2020-01-14 14:40 ` Gix, Brian [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=4d564a2af113af28b39b947900c50e8a8dd11d9b.camel@intel.com \
    --to=brian.gix@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=michal.lowas-rzechonek@silvair.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).