mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
973b6f69bf
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. |
||
---|---|---|
.. | ||
icmpv6 | ||
ipv6 | ||
ndp | ||
sixlowpan |