mesh: Clear prov capabilities structure before reading 77/229677/1
authorBrian Gix <brian.gix@intel.com>
Wed, 1 Apr 2020 18:02:57 +0000 (11:02 -0700)
committerAnupam Roy <anupam.r@samsung.com>
Wed, 1 Apr 2020 21:03:36 +0000 (02:33 +0530)
Capabilities need to be zero'd before realtime reading fresh values,
because they are mostly bitmasks, which are set when capabilities are
detected, and never otherwise cleared.

Change-Id: Ie01556568ca1601685445391b4e7c80a23c7983e
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
mesh/agent.c

index 26ccc3e..bb52f41 100644 (file)
@@ -165,6 +165,8 @@ static void parse_properties(struct mesh_agent *agent,
        const char *key, *uri_string;
        struct l_dbus_message_iter variant;
 
+       memset(&agent->caps, 0, sizeof(agent->caps));
+
        while (l_dbus_message_iter_next_entry(properties, &key, &variant)) {
                if (!strcmp(key, "Capabilities")) {
                        parse_prov_caps(&agent->caps, &variant);