Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp556454ybe; Fri, 6 Sep 2019 03:48:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3jW8BHVVa3H/jh0IBv7AWqtLJHm5s80f3dYpFkikb7Ct4yAERaZLMQyBmommKjqypvBcT X-Received: by 2002:a17:90a:d0c6:: with SMTP id y6mr8815348pjw.80.1567766922334; Fri, 06 Sep 2019 03:48:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567766922; cv=none; d=google.com; s=arc-20160816; b=kFaUB0WxCtnjfgJwW2tyPPmrWTGJ3ha5LXQbu6TEoMnVA5Al5rUXKfkfSHcva9buvQ fMIKEJoaepkmLX8G4Xj9pgQWwfKCGE0eAqgNqzsF4/Fe20/Zy1nwYaY5Ki8DcoFEDvk5 UFHDk8K9pmqR9bg4ZBflrMkgyq5W2+E91GPpjShMOpxhfrHQzjLdAP5LeoASHyBuh/Hb QfN/wTyMsqvLSnCuPZ6aFy/F6kwmUZfxboPCidqaUBG15F2tMw6GPuXjIV6uDB3MAjQX lZdwbutB29IMaq1vSqhsjz8c8IsG/aC7PBregFvrkZ/bDLp0QOjHrPhb/TQ3RhFTmqJm ZYmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=05auKXgEciMXleN23OmuPSv2R1TkfhSvfUeH4QQefEI=; b=YwcMEsOvEcqFOt3LnJWSKjeZfORaHrM5QarskfvuImxjNZ8Hwfl4qSD4ox3Hq07dVv xj7IR3jCVSylu81GA/tvXQwAaHS5WgidN3CUj/dSDnXbr9cPeRPu7cXbvDiROncjK4QZ GY3eIcI+BxWE0bctXMKl1oGNfKBGOJ9/w2GENpI1KxbUSyax9CbHtr3p68mvWULhofBQ b6OnkTIt+KpsO/BVCUVieUGmoVMu1aOlTbO2HdsDKtj13/oQEQcRL7V5k9wIDv+4YXEY lrDT4mkDthA++0cQNCekscn0CgqnxfdGma5VpBjHnisn66AKdolo6mVe9HlWe4qtjbAf QwFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=Q8Y3BVP4; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h189si4102092pgc.236.2019.09.06.03.48.20; Fri, 06 Sep 2019 03:48:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=Q8Y3BVP4; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731878AbfIFHHK (ORCPT + 99 others); Fri, 6 Sep 2019 03:07:10 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:42009 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731717AbfIFHHK (ORCPT ); Fri, 6 Sep 2019 03:07:10 -0400 Received: by mail-lf1-f66.google.com with SMTP id u13so4103016lfm.9 for ; Fri, 06 Sep 2019 00:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=05auKXgEciMXleN23OmuPSv2R1TkfhSvfUeH4QQefEI=; b=Q8Y3BVP4QBMLzbiPbD7FMjOVqAs2sX4mJpmnvrpp2X76ZVcR91LpZcuJj+hwDYk7ab P+MPLt+DPHPBYSNXCmyEo715BOzA8V1pMmID6nKY69j0KWV/N3eeMLArj/GUvKVawa5y SvuoIdcOSWwE30GocsE74ZU2pKnMYE8egKnNrZXrerrpAQHP7v3tC9j6atcamBS1oznz j38UgF+eoBlLzlgpJbCxdEZRip2t8P6zdWNWGx+84jmkDFD7Tm2tIJCYaffbjOPnS75n BeTMgs62hp7OJ3LiC+ZPH3x5p7JVK50jq40PeFpygbN/fsPsrDaZs5VGjmyy9Y3PriGK hUSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=05auKXgEciMXleN23OmuPSv2R1TkfhSvfUeH4QQefEI=; b=f0mtZqscnJq0Uk/hcAX05K33usL20+qevRcd2ET5iGo0KR6BDkBH/QaNu8iWtNULrh rkMZzEZZ41Z/fQNaJwBlEZLNtyIJlTpn/YNJmarY+uIivDkryFfZCix95YieCqaEFNfg tCiRKKlH52P6u4Qu7bDvigWVMWiXtjKd1nEJaTzrFbS4x56yGQ1AVCaMhz5oi6XHH9/W S6xjeNC0G2IHjEvySAq51YnibUuIjQRHhgWuVJkbbr+ju9ePRnBVwpXnj/Ne15844zlk xWwIvQJ/6a9gG6HhN55lIiCjuHXxFC8KSBmKAFLnegNFymXI7Dh96hbPqXveS9sfz/Rx Wmhw== X-Gm-Message-State: APjAAAVg2tOeWMLGa8wKsRd3Nu27gRlMVpSbEDPLv08+d76o4e4rNhxG DYs17a+stxcnLR+AmRCeOPYncA== X-Received: by 2002:a19:c396:: with SMTP id t144mr5332770lff.14.1567753628103; Fri, 06 Sep 2019 00:07:08 -0700 (PDT) Received: from mlowasrzechonek2133 ([217.153.94.18]) by smtp.gmail.com with ESMTPSA id z21sm767764ljn.100.2019.09.06.00.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2019 00:07:07 -0700 (PDT) Date: Fri, 6 Sep 2019 09:07:06 +0200 From: "michal.lowas-rzechonek@silvair.com" To: "Gix, Brian" Cc: "linux-bluetooth@vger.kernel.org" Subject: Re: [PATCH BlueZ] mesh: Fix IV Recovery procedure when IV Update is in progress Message-ID: <20190906070706.xtfu7ihivlsyqvn2@mlowasrzechonek2133> Mail-Followup-To: "Gix, Brian" , "linux-bluetooth@vger.kernel.org" References: <20190905131240.24969-1-michal.lowas-rzechonek@silvair.com> <3980d0c20d416de8ca17bd406cc830b03a4d9498.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3980d0c20d416de8ca17bd406cc830b03a4d9498.camel@intel.com> User-Agent: NeoMutt/20180716 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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 Silvair http://silvair.com Jasnogórska 44, 31-358 Krakow, POLAND