summaryrefslogtreecommitdiff
path: root/mesh/cfgmod-server.c
diff options
context:
space:
mode:
authorMichaƂ Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>2020-01-08 00:05:05 +0100
committerBrian Gix <brian.gix@intel.com>2020-01-08 09:07:15 -0800
commit7ff2bb9efe1764b7769d7f2bde5f3334f0f95e7e (patch)
tree2360d5dcc3666fd81a37f09bf4053a340e685732 /mesh/cfgmod-server.c
parent59d5f21e6ca7e7aa58c7a240b7b9626dd89b656c (diff)
downloadbluez-7ff2bb9efe1764b7769d7f2bde5f3334f0f95e7e.tar.gz
mesh: Fix node reset
Instead of stopping the daemon, just remove the node.
Diffstat (limited to 'mesh/cfgmod-server.c')
-rw-r--r--mesh/cfgmod-server.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c
index 8acde95b9..7111411c7 100644
--- a/mesh/cfgmod-server.c
+++ b/mesh/cfgmod-server.c
@@ -740,9 +740,11 @@ static int hb_subscription_set(struct mesh_net *net, uint16_t src,
static void node_reset(struct l_timeout *timeout, void *user_data)
{
+ struct mesh_node *node = user_data;
+
l_debug("Node Reset");
l_timeout_remove(timeout);
- l_main_quit();
+ node_remove(node);
}
static bool cfg_srv_pkt(uint16_t src, uint32_t dst, uint16_t unicast,
@@ -1265,7 +1267,11 @@ static bool cfg_srv_pkt(uint16_t src, uint32_t dst, uint16_t unicast,
case OP_NODE_RESET:
n = mesh_model_opcode_set(OP_NODE_RESET_STATUS, msg);
- l_timeout_create(1, node_reset, net, NULL);
+ /*
+ * delay node removal to give it a chance to send back the
+ * status
+ */
+ l_timeout_create(1, node_reset, node, NULL);
break;
}