diff options
author | Inga Stotland <inga.stotland@intel.com> | 2020-08-06 18:38:27 -0700 |
---|---|---|
committer | Brian Gix <brian.gix@intel.com> | 2020-08-10 14:47:08 -0700 |
commit | 72f85660fb8b6d74f3d56045601c00751e50af35 (patch) | |
tree | 9130a002e0c710300208e82cb1273800f85cafbb /mesh/cfgmod-server.c | |
parent | 1a2a6debd00ae2c175a119569a67bf49472fb651 (diff) | |
download | bluez-72f85660fb8b6d74f3d56045601c00751e50af35.tar.gz |
mesh: Clean up handling of config node identity message
This modification allows using a single point for sending out
the composed status messages by the Config Server.
Diffstat (limited to 'mesh/cfgmod-server.c')
-rw-r--r-- | mesh/cfgmod-server.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c index 992279165..82938dc83 100644 --- a/mesh/cfgmod-server.c +++ b/mesh/cfgmod-server.c @@ -777,11 +777,7 @@ static bool cfg_srv_pkt(uint16_t src, uint16_t dst, uint16_t app_idx, break; case OP_NODE_IDENTITY_SET: - if (size != 3 || pkt[2] > 0x01) - return true; - - n_idx = l_get_le16(pkt); - if (n_idx > 0xfff) + if (size != 3) return true; /* Currently setting node identity not supported */ @@ -789,18 +785,15 @@ static bool cfg_srv_pkt(uint16_t src, uint16_t dst, uint16_t app_idx, /* Fall Through */ case OP_NODE_IDENTITY_GET: - if (size < 2) + if (opcode == OP_NODE_IDENTITY_GET && size != 2) return true; n_idx = l_get_le16(pkt); - if (n_idx > 0xfff) + if (n_idx > NET_IDX_MAX) return true; n = mesh_model_opcode_set(OP_NODE_IDENTITY_STATUS, msg); - - status = mesh_net_get_identity_mode(net, n_idx, &state); - - msg[n++] = status; + msg[n++] = mesh_net_get_identity_mode(net, n_idx, &state); l_put_le16(n_idx, msg + n); n += 2; |