Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2919434ybi; Mon, 1 Jul 2019 22:24:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbYDswcTIOvcQi+MUjlXXfTiUOeGA2zrIUs8OovaU2Yx6wSLi0D7qb3MuEbCZ5xFutIqrd X-Received: by 2002:a63:570c:: with SMTP id l12mr29797325pgb.25.1562045072764; Mon, 01 Jul 2019 22:24:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562045072; cv=none; d=google.com; s=arc-20160816; b=QXrw8czd8vHMBUdbLZYwMrPArNpkeSHVbsdikktvcvvQ7S8+sWOWFK0wJhjKPopuRC YzaDhHxQbdpFqeWyDgORAzQzZT6OQLbGWyx2unElJTJAEou8u3WuE7RGp1mSgt6XuC/1 n0Rg2JBh3Lr2QaQJO3JAAOj0j1iIZHpNf8IjFP9Y/eTlpo1meAfvmnz1s5rD7j7iXun6 wjf7musnPx9GmXa2QJL0Q1s4UmpzgtpFw+WGW+KP9AAOiJZ5jEfe9VPWs26JDbswZnB/ 00MWUhSUzSI0f6zOEKfnGytm3k+yjmVGaYq4qn/pga5zDsCLqdelKSsn42Zfwl2eFBD3 IbRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:to:from; bh=UD6ibtIUKuna4SFriXrmaSWw4kraa8Nt25OJ4T1qbW0=; b=Ounmo1a8sF9UZo9cKDC9a8oslu3iJK7GZHQl1HO7btTFXNHkwkCgSvdDEqe46SUjh+ JkjZ/J3wxTMnIJ8rOI4PVdqqW5yev+5elPe7GWGuSEcib82ieXCza77Rm4gRBVbv+Erz CkCYMmATxSPfoFTqqp6h3yQr04X3z84pEivZzZNIR/74Dgm/T2KPkJAWs/60S/lzy8FZ f5FjY9vG60viXlCGcL40r9Rp3n1WT+C6gynVXxHefUSVk5FNaLPXScAaYYU8m6YHqx+W EmTjBM5E8J8XoGc04v9H6IpmdCVPspJ71lNN602/bZw9Yvhs9Pv5DRT/sntRX02uwDmX Rxfg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k73si1564759pge.353.2019.07.01.22.24.01; Mon, 01 Jul 2019 22:24:32 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725801AbfGBFYB (ORCPT + 99 others); Tue, 2 Jul 2019 01:24:01 -0400 Received: from mga02.intel.com ([134.134.136.20]:35925 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725789AbfGBFYA (ORCPT ); Tue, 2 Jul 2019 01:24:00 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jul 2019 22:23:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,442,1557212400"; d="p7s'?scan'208";a="166063799" Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by orsmga003.jf.intel.com with ESMTP; 01 Jul 2019 22:23:35 -0700 Received: from orsmsx123.amr.corp.intel.com (10.22.240.116) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 1 Jul 2019 22:23:34 -0700 Received: from orsmsx103.amr.corp.intel.com ([169.254.5.135]) by ORSMSX123.amr.corp.intel.com ([169.254.1.46]) with mapi id 14.03.0439.000; Mon, 1 Jul 2019 22:23:34 -0700 From: "Stotland, Inga" To: "jakub.witowski@silvair.com" , "linux-bluetooth@vger.kernel.org" Subject: Re: [PATCH] mesh: Allow to set-up the CRPL with application Thread-Topic: [PATCH] mesh: Allow to set-up the CRPL with application Thread-Index: AQHVMAIfSSEJOTZgEEqXsSD6WFMDw6a3QeUA Date: Tue, 2 Jul 2019 05:23:33 +0000 Message-ID: References: <20190701114239.8792-1-jakub.witowski@silvair.com> In-Reply-To: <20190701114239.8792-1-jakub.witowski@silvair.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.252.207.138] Content-Type: multipart/signed; micalg=sha-1; protocol="application/x-pkcs7-signature"; boundary="=-0S/YZf1fDba4DdqdE0lD" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --=-0S/YZf1fDba4DdqdE0lD Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Jakub, On Mon, 2019-07-01 at 13:42 +0200, Jakub Witowski wrote: > This implementation adds possibility of adding CRPL to the node > via application in the same way as CIP VID or PID. Basically, you're exposing CRPL as a property so let's rephrase the commit message as something like: "This adds an optional CRPL property to org.bluez.mesh.Application1 interface, allowing to indicate the depth of reply protection list." > --- > doc/mesh-api.txt | 4 ++++ > mesh/node.c | 12 ++++++++++-- > 2 files changed, 14 insertions(+), 2 deletions(-) >=20 > diff --git a/doc/mesh-api.txt b/doc/mesh-api.txt > index 4e0a8bff1..45fc431fa 100644 > --- a/doc/mesh-api.txt > +++ b/doc/mesh-api.txt > @@ -724,6 +724,10 @@ Properties: > =20 > A 16-bit vendor-assigned product version identifier > =20 > + uint16 CRPL [read-only] [read-only] -> [read-only, optional] I'd prefer this to be an optional property. If not found, the daemon uses its default setting (see comment below) > + > + A 16-bit reply protection value A 16-bit minimum number of replay protection list entries > + > =20 > Mesh Element Hierarchy > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > diff --git a/mesh/node.c b/mesh/node.c > index 4e35bb3ff..9372d540a 100644 > --- a/mesh/node.c > +++ b/mesh/node.c > @@ -55,7 +55,6 @@ > /* Default element location: unknown */ > #define DEFAULT_LOCATION 0x0000 > =20 > -#define DEFAULT_CRPL 10 Let's keep the default value and make the property optional. > #define DEFAULT_SEQUENCE_NUMBER 0 > =20 > #define REQUEST_TYPE_JOIN 0 > @@ -1302,7 +1301,6 @@ static void set_defaults(struct mesh_node > *node) > if (!node->comp) > node->comp =3D l_new(struct node_composition, 1); > =20 > - node->comp->crpl =3D DEFAULT_CRPL; Let's remove the node->comp allocation here altogether. Instead, in get_app_properties, add the default value setting: if (is_new) { node->comp =3D l_new(struct node_composition, 1); node->comp->crpl =3D DEFAULT_CRPL; } If CRPL property is present, the default is overwritten. > node->lpn =3D MESH_MODE_UNSUPPORTED; > node->proxy =3D MESH_MODE_UNSUPPORTED; > node->friend =3D MESH_MODE_UNSUPPORTED; > @@ -1359,6 +1357,16 @@ static bool get_app_properties(struct > mesh_node *node, const char *path, > return false; > =20 > node->comp->vid =3D value; > + > + } else if (!strcmp(key, "CRPL")) { > + if (!l_dbus_message_iter_get_variant(&variant, > "q", > + =09 > &value)) > + return false; > + > + if (!is_new && node->comp->crpl !=3D value) > + return false; > + > + node->comp->crpl =3D value; > } > } > =20 --=-0S/YZf1fDba4DdqdE0lD Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGS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