While it is correct to not use an invalid address as a source address,
it is incorrect to assume that addresses not assigned to the interface
(`idx == -1` in the respective piece of code) are invalid: Other than
classic forwarding via a FIB, forwarded packets utilizing a IPv6
routing header will pass this check, like any other packet sent by this
node. The source address for these is not on the given node, so e.g.
source routing is not possible at the moment.
During production it is often desirable for devices to perform
some kind of basic self-test to isolate defects.
For this it is necessary for the initialization not to hang if a
component is faulty / not connected.
This moves an already exising self-test that was previously enabled
as a debug option to an independent compile-time configurable.
It is necessary to call this in _init() before mrf24j40_hardware_reset()
as the reset function uses xtimer_usleep() which will cause another
thread to get scheduled.
If this thread (e.g. rpl or ipv6) then tries to access the netdev, RIOT
will crash.
If the destination address or an address within the source route is
multicast within a RPL source routing header, a receiving node is
supposed to just discard the packets, but not to send an ICMPv6 error
message, as the test assumes at the moment.
Source: https://tools.ietf.org/html/rfc6554#section-4.2
When hooking up the mrf24j40 to a bluepill board, the driver would
always get stuck on init.
Debugging revealed that it would get stuck in the mrf24j40_reset_state_machine()
function because it expects the RFSTATE to have a special value after reset.
However, the data sheet does not mention this in section 3.1 Reset.
Waiting 192µs should be enough - the value of the RFSTATE is not specified.
The Linux driver also does not wait for the RFSTATE register.
And even without the loop, the driver is functioning fine.
Two Functions cmd_test_xtimer_mutex_lock_timeout_low_prio_thread and thread_low_prio_test are added.
This testfunction will test xtimer_mutex_lock_timeout with two threads (main thread and lower prio than main thread).
The main thread creates another thread and sleeps. While the main thread sleeps the other thread takes the mutex
and wakes the main thread up.
Then the main thread calls xtimer_mutex_lock_timeout and the second thread unlocks the mutex and
the main thread gets it and waits for the created thread to end.
Has test messages showing the thread count. To make sure the created thread ends.
(test messages may be removed in the future)
Removing the periph_timer feature requirement, which isn't
directly required by this examples but rather by xtimer.
The latter set this requirement already in Makefile.dep
hence, it is duplicated and not necessary here.
The IPv6 (extension) headers of the first fragment received are re-used
for the reassembled packet, so when receiving a subsequent packet we
need to distinguish, if we just want to release the payload or all of
the packet after the packet data was added to the reassembly buffer.
Adds a test case for when the following conditions cause a crash:
- a subsequent fragment is received before the first
- the reassembly buffer is currently filled up when another fragment of
a different datagram arrives and thus needs to be cached out to make
room for the new reassembly