Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp298513ybl; Tue, 28 Jan 2020 03:27:16 -0800 (PST) X-Google-Smtp-Source: APXvYqzyWuzoeI8tvy1X2PtLWk8iOkd5gPBE3hsxKF5tk9LtIyq4wDkqP3GQQeO+YFECmHixUNL9 X-Received: by 2002:a9d:811:: with SMTP id 17mr16438825oty.369.1580210836448; Tue, 28 Jan 2020 03:27:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580210836; cv=none; d=google.com; s=arc-20160816; b=nk6I3C+zIankSB82mX7DQgkAq/ksfDj2llvUBbaNlMCtyAUvha+qUHhwK5hwdGeRl7 lKKPCJMlho3EQ1GdbQH+U6T1atG6orOHfirJymcsPDKYi2C2i1pdCFTbkmyaKf0vUPYv beqiu99ZeEr+lhNcWwCo6LhFqIhIF+yRbnwmHRac5Uw3VwzVKdaQa+cHI6ZY3K1L67nW HSjaXIHq/ev66tRfha2Z+MJmdiq2e7zhKUFby73T3msfobunxWmbqYhKLj3M/qy7Q6YL 2cE+/XSyDv97j2WlDvtiLPxMgriqnVNJgNLUUODuQ562XRCs8Rq2Ed6PssINu+h7EwlP 6H4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=arNb1j3i4GvNRlcn37kgR9usAhnBUODhruewU4zCDlA=; b=ah2c/oIPvS7IJ5JsmFRyyImMf/P1wfZo1860tLdWWVp6Wi+zKbo04aMfqC/7+8bpVV Ajev0rzIz/BhX5WPOVcIln9dT5XqdwMWkigpMHKXw7+Kkr1fsPDlZ0OmRlOlgkkxwPcn szEfMkz8tw9Ng2D/IlmcQGENHM3VD8+slvb3YiMj4GYkDSaNFvrOWR1BoQS+u9KmA8kF l6AhbKQ7kF4FwfaraBbI9mzAlAW3IBG8sKcX7SPmjgJL9/fAu15tMxujy8goV1E9xF6w 4zqFLqclBMymq2qhZpLUvui10VP0dO6jlTODMlguDNxtIg73zqgn2QA5+1FwBEd3Gf8L EgmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=2Ql1gmZ8; 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 j17si8174875otl.278.2020.01.28.03.26.56; Tue, 28 Jan 2020 03:27:16 -0800 (PST) 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=2Ql1gmZ8; 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 S1725937AbgA1L04 (ORCPT + 99 others); Tue, 28 Jan 2020 06:26:56 -0500 Received: from mail-vs1-f44.google.com ([209.85.217.44]:44089 "EHLO mail-vs1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbgA1L0z (ORCPT ); Tue, 28 Jan 2020 06:26:55 -0500 Received: by mail-vs1-f44.google.com with SMTP id p6so7787812vsj.11 for ; Tue, 28 Jan 2020 03:26:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=arNb1j3i4GvNRlcn37kgR9usAhnBUODhruewU4zCDlA=; b=2Ql1gmZ8RviEtZ7yzqWOEntCsZwCoCWzTO0KKvirjPnb9RsrqT7ovAd7tx4XAkJXPg SD/ap43u4ygRJSUQ7xmPaiQifylGMAT5wrFm8qotllkCtWJ1FDEdypM9Dcaop4CJqJpP giqFJPZMoIRZVQGG8MF1SjTTB3GPVDcn8fwmsxCNum9ps4zEaWQiSYY+tToFeXejLh3t mf6X6bclOoEd9AdievmlYPd6nRhfjIk+zOxWtU9WuxuchIQ5WSJWgXkhSkVKR03AY6X5 GHu85nYjAE0IoMyUqggo7WfuxQKzGto3WokLg/2h9shmx31fpi3flnr0j6e8yhHDowRn J8TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=arNb1j3i4GvNRlcn37kgR9usAhnBUODhruewU4zCDlA=; b=tbHslvS6z4isGcR2dZ0s2r5/24n4AoftSzTZqfhR+J6L8J1h6bgTl3ERRgAXa0/2VW FRLTkbaf3X3/llVeRjkemND5oQwhd+DItszLgXAWnZwOJxAVjoZ1zpJzw86ZCJd6AhsI xPFZr1Oe0CoKVnLfuHWl0a3Ulivpdl1T0529y79VJ0c0YtWMJbDGKGC3R1P8Bhp0eszt QR1GsgCxq0FOS6Rbs/j6swj7badeQXVC9w8soJeEMtSGdRibLCNFVAM4YYhIW6yQCWvC z+GXhInRAhrYzKypohg4ZBcYWUcBtBRo//zlKKKHOsRaQZ6V6M23p9a4xSFG69mIrNiv eBzQ== X-Gm-Message-State: APjAAAW+nvXyYBjFm1zqC4CJZnvNQXwW4jrfObv0KvwAI1IeqMD9DBsd I/bFLXyTzj33LNJJOMD2tQh5hUatAzoME7BpX0hM14nhUEQ= X-Received: by 2002:a67:d703:: with SMTP id p3mr15028396vsj.185.1580210814693; Tue, 28 Jan 2020 03:26:54 -0800 (PST) MIME-Version: 1.0 References: <20200125004350.4640-1-brian.gix@intel.com> In-Reply-To: From: =?UTF-8?B?UmFmYcWCIEdhamRh?= Date: Tue, 28 Jan 2020 12:26:43 +0100 Message-ID: Subject: Re: [PATCH BlueZ v2 0/5] mesh: Add NVM storage of Replay Protection List To: Brian Gix Cc: linux-bluetooth@vger.kernel.org, inga.stotland@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi, pon., 27 sty 2020 o 22:27 Rafa=C5=82 Gajda napisa= =C5=82(a): > > It looks like sequence number is correctly incremented when calling > DevKeySend but it isn't incremented at all when ConfigModel sends the > reply back. I think the culprit is in mesh/net.c in mesh_net_app_send() line 3160: > /* First enqueue to any Friends and internal models */ > result =3D msg_rxed(net, false, iv_index, ttl, > seq + seg_max, > net_idx, > src, dst, > key_aid,szmic, seq & SEQ_ZERO_MASK, > msg, msg_len); > > /* If addressed to a unicast address and successfully enqueued, > * or delivered to one of our Unicast addresses we are done > */ > if ((result && IS_UNICAST(dst)) || src =3D=3D dst || > (dst >=3D net->src_addr && dst <=3D net->last_addr)) { > /* Adjust our seq_num for "virtual" delivery */ > net->seq_num +=3D seg_max; > return true; > } When sending the message we first deliver it to internal models and only after that we increment the msg sequence number. If we do "net->seq_num +=3D seg_max" before calling msg_rxed() then messages are delivered correctly. --=20 Rafa=C5=82 Gajda Silvair Sp. z o.o.