From: "Gix, Brian" <brian.gix@intel.com>
To: "linux-bluetooth@vger.kernel.org"
<linux-bluetooth@vger.kernel.org>,
"rafal.gajda@silvair.com" <rafal.gajda@silvair.com>
Subject: Re: [PATCH BlueZ] mesh: Fix to duplicated model Ids saved to storage
Date: Wed, 26 Jun 2019 17:32:58 +0000 [thread overview]
Message-ID: <1561570377.22940.17.camel@intel.com> (raw)
In-Reply-To: <20190626154902.18904-1-rafal.gajda@silvair.com>
Applied with minor commit message change, Thanks
On Wed, 2019-06-26 at 17:49 +0200, Rafał Gajda wrote:
> BlueZ internally implements a SIG model for Config Server.
>
> When generating node, if the Mesh Element in mesh application returns modelId 0
> among its supported models, it should be skipped, otherwise it will be
> duplicated and saved in the storage file.
>
> This patch fixes correctly skipping Config Server model during node creation.
> ---
> mesh/node.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/mesh/node.c b/mesh/node.c
> index e99858623..4e35bb3ff 100644
> --- a/mesh/node.c
> +++ b/mesh/node.c
> @@ -1061,10 +1061,9 @@ static bool validate_model_property(struct node_element *ele,
> /* Bluetooth SIG defined models */
> while (l_dbus_message_iter_next_entry(&ids, &mod_id)) {
> struct mesh_model *mod;
> - uint32_t m = mod_id;
>
> /* Skip internally implemented models */
> - if (m == CONFIG_SRV_MODEL)
> + if ((VENDOR_ID_MASK | mod_id) == CONFIG_SRV_MODEL)
> continue;
>
> mod = l_queue_find(ele->models, match_model_id,
> @@ -1078,6 +1077,7 @@ static bool validate_model_property(struct node_element *ele,
> while (l_dbus_message_iter_next_entry(&ids, &vendor_id,
> &mod_id)) {
> struct mesh_model *mod;
> +
> mod = l_queue_find(ele->models, match_model_id,
> L_UINT_TO_PTR((vendor_id << 16) | mod_id));
> if (!mod)
> @@ -1108,10 +1108,9 @@ static void get_models_from_properties(struct node_element *ele,
> if (!vendor) {
> while (l_dbus_message_iter_next_entry(&ids, &mod_id)) {
> struct mesh_model *mod;
> - uint32_t m = mod_id;
>
> /* Skip internally implemented models */
> - if (m == CONFIG_SRV_MODEL)
> + if ((VENDOR_ID_MASK | mod_id) == CONFIG_SRV_MODEL)
> continue;
>
> mod = mesh_model_new(ele->idx, mod_id);
prev parent reply other threads:[~2019-06-26 17:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-26 15:49 [PATCH BlueZ] mesh: Fix to duplicated model Ids saved to storage Rafał Gajda
2019-06-26 17:32 ` Gix, Brian [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=1561570377.22940.17.camel@intel.com \
--to=brian.gix@intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=rafal.gajda@silvair.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.