[PATCH BlueZ 1/2] mesh: Always set net modes based on node feature settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 intialization unconditional, to include the "No Support"
setting on node level which should result in the disabled mode in net.c
---
 mesh/node.c | 18 +++++-------------
 1 file 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,
-- 
2.26.2




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux