New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sys/shell/commands/gnrc_icmpv6_echo: test for ICMPv6 reply corruption #15622
Conversation
edd74fa
to
2178ecc
Compare
2178ecc
to
e63927b
Compare
Mh, is that feature optional on Linux? Because, as documented, RIOT/sys/shell/commands/sc_gnrc_icmpv6_echo.c Lines 15 to 19 in e63927b
the implementation is partly based on the Linux implementation. |
(So my actual question is: should we make this optional using a command-line flag?) |
At any rate this most likely will need an adaptation of the corresponding RIOT/dist/pythonlibs/riotctrl_shell/gnrc.py Lines 485 to 499 in 5f7a7bc
And its corresponding parser RIOT/dist/pythonlibs/riotctrl_shell/gnrc.py Lines 122 to 137 in 5f7a7bc
To deal with the new behavior. |
What would we gain by making this optional? The Linux ping utility will always do the corruption check. |
You wouldn't need to adapt the
The reply["corrupt"] = {"bytes": bytes, "offset": offset} |
I did a thing. (the reply can either be truncated or corrupted. A truncated reply is not checked for corruption as it's already damaged) |
66df92a
to
aaf8cba
Compare
158b4e1
to
464686b
Compare
How can I test |
Type |
(see also the |
278c6f9
to
8245b12
Compare
Thank you for the hint with |
Now only the |
Heh, I thought we bumped the limit to 100 characters, but only for C code it seems. |
For C code the coding conventions also still say 80 chars as soft target. |
(but we actually aim for PEP8 compliance in the pythonlibs (not in the test scripts though)) |
const uint8_t *data = buf; | ||
|
||
if (len >= sizeof(uint32_t)) { | ||
*triptime = xtimer_now_usec() - unaligned_get_u32(buf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now
is now much later fetched. Can this be a problem? Ideally this should come directly after the receive and maybe provided as a parameter to _check_payload()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the time capture to the _handle_reply()
call so we get the time right after msg_receive()
returned.
563bf5c
to
0287c81
Compare
Using master
This PR
Tox for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
The Linux ping utility has the nice feature that fills the ICMPv6 echo request payload with a pattern `payload_index & 0xFF`. Then the ICMPv6 echo response payload is checked to verify that the pattern is still intact. This way corrupted messages can be detected. In the past that revealed some 6lo-fragmentation bugs in Linux when corrupted replies arrived. This feature is also useful for RIOT, so implement it in RIOTs `ping` command.
0287c81
to
b0b8c5a
Compare
Just to be absolutely sure there is not a problem introduced with |
Only the usual suspects (LoRaWAN and a test where the nodes are picked way to far apart) fail. So gooo! |
Contribution description
The Linux ping utility has the nice feature that fills the ICMPv6 request payload with a pattern
payload_index & 0xFF
.Then the ICMPv6 response payload is checked to verify that the pattern is still intact.
This way corrupted messages can be detected.
In the past that revealed some 6lo-fragmentation bugs in Linux when corrupted replies arrived.
This feature is also useful for RIOT, so implement it in RIOTs
ping
command.Testing procedure
ping
should still work with varying lengths.If packet corruption happened on the data path, this should now be reported.
Issues/PRs references