Diff between f5c178d1dcc977175a85a5cd0db9774376add08f and 8a29b59d98b301df8331b4ca4dc9e150e67beee6

Changed Files

File Additions Deletions Status
mesh/mesh-config-json.c +1 -1 modified
mesh/node.c +2 -2 modified

Full Patch

diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
index b2cff68..5ca2961 100644
--- a/mesh/mesh-config-json.c
+++ b/mesh/mesh-config-json.c
@@ -358,7 +358,7 @@ static bool read_default_ttl(json_object *jobj, uint8_t *ttl)
 	if (!val && errno == EINVAL)
 		return false;
 
-	if (val < 0 || val == 1 || val > DEFAULT_TTL)
+	if (val < 0 || val == 1 || val > TTL_MASK)
 		return false;
 
 	*ttl = (uint8_t) val;
diff --git a/mesh/node.c b/mesh/node.c
index d433c2d..65ea5e6 100644
--- a/mesh/node.c
+++ b/mesh/node.c
@@ -681,7 +681,7 @@ struct l_queue *node_get_element_models(struct mesh_node *node,
 uint8_t node_default_ttl_get(struct mesh_node *node)
 {
 	if (!node)
-		return DEFAULT_TTL;
+		return TTL_MASK;
 	return node->ttl;
 }
 
@@ -1370,7 +1370,7 @@ static void set_defaults(struct mesh_node *node)
 	node->friend = MESH_MODE_UNSUPPORTED;
 	node->beacon = MESH_MODE_DISABLED;
 	node->relay.mode = MESH_MODE_DISABLED;
-	node->ttl = DEFAULT_TTL;
+	node->ttl = TTL_MASK;
 	node->seq_number = DEFAULT_SEQUENCE_NUMBER;
 
 	/* Add configuration server model on primary element */