summaryrefslogtreecommitdiff
path: root/mesh/node.c
diff options
context:
space:
mode:
authorInga Stotland <inga.stotland@intel.com>2020-08-18 15:22:07 -0700
committerBrian Gix <brian.gix@intel.com>2020-08-20 07:26:28 -0700
commitbff0b258e3cc87e18a622cfbf3d38a82f41e5eac (patch)
tree43298579b4d27a24297abd2a55e68a3249aeec99 /mesh/node.c
parent8fe6fddd9bfb4798d68c6df674f9d5d33d45c3c0 (diff)
downloadbluez-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.c18
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,