net: lwm2m: check lwm2m path level while getting the block ctx
The Block1 context for composite operations is not found, as all path levels are compared. The incoming path level should therefore always be taken into account. Signed-off-by: Simon Walz <simon.walz@autosen.com>
This commit is contained in:
parent
c41d88740a
commit
e20ef4443e
1 changed files with 1 additions and 2 deletions
|
|
@ -175,8 +175,7 @@ static int get_block_ctx(const struct lwm2m_obj_path *path, struct lwm2m_block_c
|
||||||
*ctx = NULL;
|
*ctx = NULL;
|
||||||
|
|
||||||
for (i = 0; i < NUM_BLOCK1_CONTEXT; i++) {
|
for (i = 0; i < NUM_BLOCK1_CONTEXT; i++) {
|
||||||
if (memcmp(path, &block1_contexts[i].path,
|
if (lwm2m_obj_path_equal(path, &block1_contexts[i].path)) {
|
||||||
sizeof(struct lwm2m_obj_path)) == 0) {
|
|
||||||
*ctx = &block1_contexts[i];
|
*ctx = &block1_contexts[i];
|
||||||
/* refresh timestamp */
|
/* refresh timestamp */
|
||||||
(*ctx)->timestamp = k_uptime_get();
|
(*ctx)->timestamp = k_uptime_get();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue