diff options
author | Inga Stotland <inga.stotland@intel.com> | 2020-08-18 15:22:07 -0700 |
---|---|---|
committer | Brian Gix <brian.gix@intel.com> | 2020-08-20 07:26:28 -0700 |
commit | bff0b258e3cc87e18a622cfbf3d38a82f41e5eac (patch) | |
tree | 43298579b4d27a24297abd2a55e68a3249aeec99 /mesh/node.c | |
parent | 8fe6fddd9bfb4798d68c6df674f9d5d33d45c3c0 (diff) | |
download | bluez-bff0b258e3cc87e18a622cfbf3d38a82f41e5eac.tar.gz |
mesh: Always set net modes based on node feature settings
The network settings such as relay, beacon, proxy and friend are
always set based on local node feature settings. This change makes
the net modes initialization unconditional, to include the "No Support"
setting on node level which should result in the disabled mode in net.c
Diffstat (limited to 'mesh/node.c')
-rw-r--r-- | mesh/node.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/mesh/node.c b/mesh/node.c index 1eeffeb8b..ebc111a62 100644 --- a/mesh/node.c +++ b/mesh/node.c @@ -399,24 +399,16 @@ static bool init_storage_dir(struct mesh_node *node) static void update_net_settings(struct mesh_node *node) { - uint8_t mode; + struct mesh_net *net = node->net; - mode = node->proxy; - if (mode == MESH_MODE_ENABLED || mode == MESH_MODE_DISABLED) - mesh_net_set_proxy_mode(node->net, mode == MESH_MODE_ENABLED); + mesh_net_set_proxy_mode(net, node->proxy == MESH_MODE_ENABLED); - mode = node->friend; - if (mode == MESH_MODE_ENABLED || mode == MESH_MODE_DISABLED) - mesh_net_set_friend_mode(node->net, mode == MESH_MODE_ENABLED); + mesh_net_set_friend_mode(net, node->friend == MESH_MODE_ENABLED); - mode = node->relay.mode; - if (mode == MESH_MODE_ENABLED || mode == MESH_MODE_DISABLED) - mesh_net_set_relay_mode(node->net, mode == MESH_MODE_ENABLED, + mesh_net_set_relay_mode(net, node->relay.mode == MESH_MODE_ENABLED, node->relay.cnt, node->relay.interval); - mode = node->beacon; - if (mode == MESH_MODE_ENABLED || mode == MESH_MODE_DISABLED) - mesh_net_set_beacon_mode(node->net, mode == MESH_MODE_ENABLED); + mesh_net_set_beacon_mode(net, node->beacon == MESH_MODE_ENABLED); } static bool init_from_storage(struct mesh_config_node *db_node, |