Skip to content

Commit 7bc2a1b

Browse files
etiennedmfabiobaltieri
authored andcommitted
net: lwm2m: Fix data cache rollback logic compilation
The root cause of this issue is a modification of `struct ring_buf` in 3075a7d. Even though all the fields of the struct are marked as internal, the LwM2M code is using some of them to roll back the state of the ring buffer on failure. Signed-off-by: Etienne de Maricourt <edmecomemail@gmail.com>
1 parent 333fadd commit 7bc2a1b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

subsys/net/lib/lwm2m/lwm2m_message_handling.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,9 +1403,9 @@ static int lwm2m_read_cached_data(struct lwm2m_message *msg,
14031403
read_info = &msg->cache_info->read_info[msg->cache_info->entry_size];
14041404
/* Store original timeseries ring buffer get states for failure handling */
14051405
read_info->cache_data = cached_data;
1406-
read_info->original_get_base = cached_data->rb.get_base;
1407-
read_info->original_get_head = cached_data->rb.get_head;
1408-
read_info->original_get_tail = cached_data->rb.get_tail;
1406+
read_info->original_get_base = cached_data->rb.get.base;
1407+
read_info->original_get_head = cached_data->rb.get.head;
1408+
read_info->original_get_tail = cached_data->rb.get.tail;
14091409
msg->cache_info->entry_size++;
14101410
if (msg->cache_info->entry_limit) {
14111411
length = MIN(length, msg->cache_info->entry_limit);
@@ -3079,11 +3079,11 @@ static bool lwm2m_timeseries_data_rebuild(struct lwm2m_message *msg, int error_c
30793079

30803080
/* Put Ring buffer back to original */
30813081
for (int i = 0; i < cache_temp->entry_size; i++) {
3082-
cache_temp->read_info[i].cache_data->rb.get_head =
3082+
cache_temp->read_info[i].cache_data->rb.get.head =
30833083
cache_temp->read_info[i].original_get_head;
3084-
cache_temp->read_info[i].cache_data->rb.get_tail =
3084+
cache_temp->read_info[i].cache_data->rb.get.tail =
30853085
cache_temp->read_info[i].original_get_tail;
3086-
cache_temp->read_info[i].cache_data->rb.get_base =
3086+
cache_temp->read_info[i].cache_data->rb.get.base =
30873087
cache_temp->read_info[i].original_get_base;
30883088
}
30893089

0 commit comments

Comments
 (0)