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/ipv6
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
..
blacklist sys/*: realign ENABLE_DEBUG 2020-10-23 11:27:48 +02:00
ext gnrc/ipv6_ext_opt: fix compilation with NDEBUG 2021-12-09 16:44:19 +01:00
hdr sys/*: realign ENABLE_DEBUG 2020-10-23 11:27:48 +02:00
nib Merge pull request #18127 from benpicco/gnrc/nib-no_default_router_from_wpan 2022-05-24 00:38:43 +02:00
whitelist sys/*: realign ENABLE_DEBUG 2020-10-23 11:27:48 +02:00
gnrc_ipv6.c sys/net/netopt: change NETOPT_STATS semantics 2022-06-28 16:57:43 +02:00
Kconfig treewide: change prefix for generated Kconfig symbols. 2020-08-31 09:37:09 +02:00
Makefile gnrc: make all gnrc modules sub-modules of gnrc 2015-08-18 23:00:07 +02:00