From: "Michał Lowas-Rzechonek" <michal.lowas-rzechonek@silvair.com>
To: Brian Gix <brian.gix@intel.com>
Cc: linux-bluetooth@vger.kernel.org, inga.stotland@intel.com
Subject: Re: [PATCH BlueZ 3/3] mesh: Propagate Net Index up Rx message chain
Date: Wed, 17 Jul 2019 10:48:53 +0200 [thread overview]
Message-ID: <20190717084853.copy2f3dc7oaglf4@mlowasrzechonek2133> (raw)
In-Reply-To: <20190716225644.11449-4-brian.gix@intel.com>
Hi Brian,
On 07/16, Brian Gix wrote:
> When a model receives a message, it is required by the spec
> to respond using the same credentials. When an App Key is used,
> this is trivial because App keys are bound to Net keys, so only
> the App Index is required. Messages received on a Device key
> however, need the Net Index preserved from original message for
> re-use during the response.
> ---
> mesh/cfgmod-server.c | 154 ++++++++++++++++++++++++++++-----------------------
> mesh/model.c | 129 +++++++++++++++++++++---------------------
> mesh/model.h | 10 ++--
> mesh/net.c | 92 +++++++++++++++++-------------
> mesh/net.h | 6 +-
> mesh/node.c | 10 ++--
> 6 files changed, 214 insertions(+), 187 deletions(-)
>
(...)
> diff --git a/mesh/net.c b/mesh/net.c
> index a5693f154..ba52867c4 100644
> --- a/mesh/net.c
> +++ b/mesh/net.c
> @@ -119,7 +119,6 @@ struct mesh_net {
> unsigned int pkt_id;
> unsigned int bea_id;
> unsigned int beacon_id;
> - unsigned int key_id_next;
> unsigned int sar_id_next;
>
> bool friend_enable;
> @@ -203,7 +202,7 @@ struct mesh_sar {
> bool frnd_cred;
> uint8_t ttl;
> uint8_t last_seg;
> - uint8_t key_id;
> + uint8_t key_aid;
> uint8_t buf[4]; /* Large enough for ACK-Flags and MIC */
> };
>
> @@ -225,7 +224,7 @@ struct msg_rx {
> union {
> struct {
> uint16_t app_idx;
> - uint8_t key_id;
> + uint8_t key_aid;
> } m;
> struct {
> uint16_t seq0;
> @@ -668,7 +667,6 @@ struct mesh_net *mesh_net_new(struct mesh_node *node)
> net->node = node;
> net->pkt_id = 0;
> net->bea_id = 0;
> - net->key_id_next = 0;
>
> net->beacon_enable = true;
> net->proxy_enable = false;
> @@ -676,7 +674,7 @@ struct mesh_net *mesh_net_new(struct mesh_node *node)
>
> net->seq_num = 0x000000;
> net->src_addr = 0x0000;
> - net->default_ttl = 0x00;
> + net->default_ttl = 0x7f;
(...)
> @@ -3408,18 +3421,17 @@ bool mesh_net_app_send(struct mesh_net *net, bool frnd_cred, uint16_t src,
> if (!src || !dst)
> return false;
>
> - if (ttl == 0xff)
> + if (ttl == DEFAULT_TTL)
> ttl = net->default_ttl;
(...)
I would keep these in a separate patch, it's not really related to key
ids/indexes.
Otherwise, LGTM!
--
Michał Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
Silvair http://silvair.com
Jasnogórska 44, 31-358 Krakow, POLAND
next prev parent reply other threads:[~2019-07-17 8:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-16 22:56 [PATCH BlueZ 0/3] mesh: Propagate/Preserve Net Index for Access Layer Brian Gix
2019-07-16 22:56 ` [PATCH BlueZ 1/3] mesh: Add bound Net Index lookup for App Keys Brian Gix
2019-07-16 22:56 ` [PATCH BlueZ 2/3] mesh: Normalize Access Key AID naming convention Brian Gix
2019-07-16 22:56 ` [PATCH BlueZ 3/3] mesh: Propagate Net Index up Rx message chain Brian Gix
2019-07-17 8:48 ` Michał Lowas-Rzechonek [this message]
2019-07-18 17:07 ` [PATCH BlueZ 0/3] mesh: Propagate/Preserve Net Index for Access Layer Gix, Brian
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=20190717084853.copy2f3dc7oaglf4@mlowasrzechonek2133 \
--to=michal.lowas-rzechonek@silvair.com \
--cc=brian.gix@intel.com \
--cc=inga.stotland@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).