mesh: fix node default TTL
authorAurelien Jarno <aurelien@aurel32.net>
Fri, 18 Dec 2020 06:30:30 +0000 (12:00 +0530)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Mon, 28 Dec 2020 06:20:04 +0000 (11:50 +0530)
commit9fe3398954d7356eec9961ef43b530ee05f436c4
tree142652bf99a90a709690d11dce4486c5dbb32f0c
parent892f03dd5b768dead05633028ed96ea58ea2eb11
mesh: fix node default TTL

There is a confusion between the node default TTL (section 4.2.7) and
the publish TTL (section 4.2.2.5):

- The node default TTL can only take values 0x00, and 0x02 to 0x7f. The
  value 0xff is not prohibited.
- The publish TTL can take values 0x00 to 0x7f, as well as 0xff which
  means use the node default TTL.

Currently the default node TTL is set to 0xff (DEFAULT_TTL), and
read_default_ttl() also allows such a value. This patch fixes that to
use 0x7f (TTL_MASK) as the default value instead.

Note that the code handling OP_CONFIG_DEFAULT_TTL_SET correctly use 0x7f
(TTL_MASK) for the upper allowed limit.

Change-Id: If894a9eb88bd129293845c068e0b6f3685495a4c
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
mesh/cfgmod-server.c
mesh/mesh-config-json.c
mesh/node.c