1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/net/gnrc/network_layer
Marian Buschsieweke 973b6f69bf
sys/net/netopt: change NETOPT_STATS semantics
Instead of retrieving a pointer with NETOPT_STATS, retrieve the current
data. This avoids data corruptions when reading from one thread (e.g.
the thread running the shell (ifconfig command)) while another thread
is updating it (e.g. the netif thread).

The issue affects all boards, as users typically expect the count of
TX packets and the number of TX bytes to refer to the same state. For
16 bit and 8 bit platforms even a single netstat entry can read back
corrupted.

This fixes the issue by just copying the whole netstat_t struct over
without requiring explicit locking on the user side. A multi-threaded
network stack still needs to synchronize the thread responding to
netopt_get with the thread writing to the netstat_t structure, but that
is an implementation detail no relevant to the user of the API.
2022-06-28 16:57:43 +02:00
..
icmpv6 net/gnrc: avoid *timer creeping though header 2022-02-28 14:53:07 +01:00
ipv6 sys/net/netopt: change NETOPT_STATS semantics 2022-06-28 16:57:43 +02:00
ndp gnrc/ndp: bugfix set O-flag on non anycast target 2022-03-22 13:03:28 +01:00
sixlowpan sys/net/gnrc: add gnrc_tx_sync for gnrc_sixlowpan_frag_sfr 2022-05-17 14:01:57 +02:00