This repository has been archived by the owner on Sep 20, 2022. It is now read-only.
sniffer: Check for missing netif header in dump_pkt #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Avoids a hard fault when using the latest RIOT master where raw mode does not provide a netif header.
The sniffer application works without this PR on samr21-xpro, but only because of luck.
applications/sniffer/main.c
Line 61 in 39a974e
pkt->next
is NULL and the pktbuf_remove call causes an indirect write:pkt->next->next = NULL;
On frdm-kw41z (with RIOT-OS/RIOT#7107) the null pointer write causes a hard fault
for reference, here is the called function where the write happens: https://github.com/RIOT-OS/RIOT/blob/f139dfdad2c81f239e27e2be86a7857e740dc201/sys/net/gnrc/pktbuf/gnrc_pktbuf.c#L54-L62