public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: "Stotland, Inga" <inga.stotland@intel.com>
To: "inga.stotland@gmail.com" <inga.stotland@gmail.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>
Cc: "brian.gix@gmail.com" <brian.gix@gmail.com>
Subject: Re: [PATCH BlueZ] tools/mesh-cfgclient: Add local address check
Date: Mon, 20 Mar 2023 20:14:28 +0000	[thread overview]
Message-ID: <3476a5a39e8f65123a22be58e9b9e5a4b6fae2c1.camel@intel.com> (raw)
In-Reply-To: <20230320175825.321702-1-inga.stotland@gmail.com>

Do not apply: fix not needed.

On Mon, 2023-03-20 at 10:58 -0700, Inga Stotland wrote:
> This adds a check if a request to start scanning for unprovisioned
> devices is issued with the local address.
> ---
>  tools/mesh-cfgclient.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/mesh-cfgclient.c b/tools/mesh-cfgclient.c
> index 6d2d34409..8369b345d 100644
> --- a/tools/mesh-cfgclient.c
> +++ b/tools/mesh-cfgclient.c
> @@ -58,6 +58,12 @@
>  #define DEFAULT_CFG_FILE       "config_db.json"
>  #define DEFAULT_EXPORT_FILE    "export_db.json"
>  
> +/*
> + *The default unicast address assigned to a node generated with
> + * Create() method
> + */
> +#define OWN_PRIMARY_ADDR       0x0001
> +
>  struct meshcfg_el {
>         const char *path;
>         uint8_t index;
> @@ -777,7 +783,7 @@ static void attach_node_reply(struct l_dbus_proxy
> *proxy,
>         }
>  
>         /* Read own node composition */
> -       if (!cfgcli_get_comp(0x0001, 128))
> +       if (!cfgcli_get_comp(OWN_PRIMARY_ADDR, 128))
>                 l_error("Failed to read own composition");
>  
>         return;
> @@ -868,7 +874,7 @@ static void scan_start(void *user_data, uint16_t
> dst, uint32_t model)
>  {
>         struct scan_data *data;
>  
> -       if (model != (0xffff0000 | RPR_SVR_MODEL))
> +       if (model != (0xffff0000 | RPR_SVR_MODEL) || dst !=
> OWN_PRIMARY_ADDR)
>                 return;
>  
>         data = l_malloc(sizeof(struct scan_data));
> @@ -2364,8 +2370,8 @@ static struct l_dbus_message
> *join_complete(struct l_dbus *dbus,
>         keys_add_net_key(PRIMARY_NET_IDX);
>         mesh_db_add_net_key(PRIMARY_NET_IDX);
>  
> -       remote_add_node(app.uuid, 0x0001, 1, PRIMARY_NET_IDX);
> -       mesh_db_add_node(app.uuid, 0x0001, 1, PRIMARY_NET_IDX);
> +       remote_add_node(app.uuid, OWN_PRIMARY_ADDR, 1,
> PRIMARY_NET_IDX);
> +       mesh_db_add_node(app.uuid, OWN_PRIMARY_ADDR, 1,
> PRIMARY_NET_IDX);
>  
>         mesh_db_add_provisioner("BlueZ mesh-cfgclient", app.uuid,
>                                         low_addr, high_addr,


      parent reply	other threads:[~2023-03-20 20:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 17:58 [PATCH BlueZ] tools/mesh-cfgclient: Add local address check Inga Stotland
2023-03-20 19:12 ` [BlueZ] " bluez.test.bot
2023-03-20 20:14 ` Stotland, Inga [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=3476a5a39e8f65123a22be58e9b9e5a4b6fae2c1.camel@intel.com \
    --to=inga.stotland@intel.com \
    --cc=brian.gix@gmail.com \
    --cc=inga.stotland@gmail.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