The change in 399e25cc was did not have the intended effect: As the
local crates still all defined 0.7 as the riot-wrappers version, that
dependency was actually down- rather than upgraded, and thus did not
effect the stabilizations.
My spell checker says "receival" should be "reception". Also, the
terms allow list and deny list are preferred over whitelist and
blacklist. But since scripts may depend on the shell command name,
only the help description is changed, not the cmd names.
Previously `shell_commands` was a "catch-all" module that included
shell commands for each and every used module that has a shell
companion. Instead, the new `shell_cmds` module is now used to provide
shell commands as individually selectable submodules, e.g.
`cmd_gnrc_icmpv6_echo` now provides the ICMPv6 echo command (a.k.a.
ping).
To still have a "catch all" module to pull in shell commands of modules
already used, `shell_cmds_default` was introduced. `shell_commands`
depends now on `shell_cmds_default` for backward compatibility, but
has been deprecated. New apps should use `shell_cmds_default`
instead.
For a handful of shell commands individual selection was already
possible. Those modules now depend on the corresponding `cmd_%` module
and they have been deprecated.
This fixed compilation, as the use of the interal `_xtimer_now()`
function is not compatible with `ztimer_xtimer_compat`. However, this
bug never triggered due to a bug in the build system preventing the
compilation of the shell command. We are about to fix this, so let's
fix the source first.
Synchronize the RPL thread updating the RPL netstats with the RPL
shell command reading it by disabling IRQs. This will prevent printing
corrupted data on non-32bit platforms as well as printing inconsistent
data (e.g. TX count of old state in conjunction with TX bytes of new
state) for all platforms.
Co-authored-by: Martine Lenders <mail@martine-lenders.eu>
There is a repeating pattern in the struct that is split out into a
subtype in this commit. This makes handling the data easier, as now
done in the print routine.
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.
The netif list is used like a stack, so it needs to be
iterated in reverse to keep the registration order.
Time complexity in O(n^2), but the the list is normally very short
(1-2 items).
Before:
```
> ifconfig
Iface 10 HWaddr: 24:0A:C4:E6:0E:9C Channel: 0 Link: down
[..]
Iface 7 HWaddr: 24:0A:C4:E6:0E:9F Link: down
[..]
```
Now they are in the increasing order:
```
> ifconfig
Iface 7 HWaddr: 24:0A:C4:E6:0E:9F Link: down
[..]
Iface 10 HWaddr: 24:0A:C4:E6:0E:9C Channel: 0 Link: down
[..]
```
When lwIP is hacked to use the same shell command, it also
lists it interfaces in the expected order (was ET1,ET0 before):
```
> ifconfig
Iface ET0 HWaddr: 24:0A:C4:E6:0E:9F Link: down
[..]
Iface ET1 HWaddr: 24:0A:C4:E6:0E:9C Channel: 0 Link: down
[..]
```
Module to lock the shell after a given timeout of time x. When the
shell did not receive any input within time x, then the shell is
locked automatically.
Module to lock the running shell with a password. Shell is proceeded only
when the valid password was entered by the user. After 3 failed attempts,
the input is blocked for a few seconds to slow down brute force attacks.
Does not make use of any cryptographic features yet.
This solves highly theoretical race conditions of file systems being
unmounted in an application while a shell `df` runs, fixes the previous
weird behavior that `/mountpoint/non-existant-path` could be df'd and
would even report that non-existant path as a file name, but more
practically ensures that an example of vfs_iter_mount_dirs is around.
The RSSI values reported by LoRa transceiver can be less than -127.
Therefore, `int8_t` is not enough. This commit defines the RSSI of
`netdev_lora_rx_info` as `int16_t` and adapt the drivers accordingly
(sx126x, sx127x).
`msg_avail()` will return -1 if the thread has no message queue.
Casting this to unsigned will result in the `ping` command to try
receiving 4294967295 messages, which hangs the shell.
Drop the cast to `unsigned` and the loop behaves as intended.
But then it's still wrong: If new messages become available, they
would be ignored.
So change the `for` loop to a `while` loop. The index variable is
not used at all.
Currently a valid netif name must be passed to show the usage
instructions:
```
> ifconfig help
error: invalid interface given
> ifconfig 6 help
usage: ifconfig
usage: ifconfig <if_id> [up|down]
[...]
```
`ifconfig --help` is also accepted.