-
Notifications
You must be signed in to change notification settings - Fork 2.1k
gnrc_icmpv6_error: fix and use where appropriate #8594
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
gnrc_icmpv6_error: fix and use where appropriate #8594
Conversation
(for now I was mostly using |
@bergzand this looks like a simple bug fix - can you take a look? |
This is on my todo list and I will review it as soon as I have time. At the moment the +301 -149 lines changed is for me a bit too much to categorize it as a small bug fix and quickly review it. |
Good. Seems important for RIOT to get such homework done - otherwise bugs accumulate ;) |
3df8284
to
a264cd6
Compare
Rebased and adapted for master (also did some extensive testing with |
Updated testing procedures. |
I also was able to solicit a "Packet too big" error now. I used the
And injected a huge packet to that neighbor into the p = srp1(Ether() / IPv6(dst="2001:db8::1") / UDP(sport=1337, dport=1337) / (1452 * "x"), iface="tap0")
assert(ICMPv6PacketTooBig in p) |
We should put these tests somewhere btw. I'd say release specs, as soon as this is merged and the current release is out. |
(Note to self Packet too big just as before, but with a sudo ip a a beef::1/64 dev tapbr0
sudo ip r a affe::/64 via "<native link-local IPv6 address>" dev tapbr0
GNRC_NETIF_NUMOF=2 USEMODULE=socket_zep TERMFLAGS="-z [::]:17755 tap0" \
make -C examples/gnrc_networking clean all term
p = srp1(Ether(dst=DST_HWADDR) / IPv6(src="beef::1", dst="affe::1") / UDP() / (1452 * "x"), iface="tapbr0")
assert(ICMPv6PacketTooBig in p)
assert(p[ICMPv6PacketTooBig].code == 0)
assert(p[ICMPv6PacketTooBig].mtu < 1500) |
a264cd6
to
fbd7714
Compare
Rebased to current master to include fixes from #10356. |
fbd7714
to
626eaf9
Compare
As discussed offline I split the huge monolitic commit up in several smaller ones to trace my steps |
This is aimed to make the usage code of this module more readable.
1aa55b6
to
897e688
Compare
Squashed |
Enabling |
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
Tested with the testing instructions. All responses look good to me, nothing out of the ordinary, responses are properly truncated when copying the full frame would exceed the MTU.
For the record, I have no issues with the relative large amount of commits :) |
Given that it adds (optional) functionality I think that is acceptable. |
Agreed, I've always understood that the examples should showcase the functionality and I'd say that this one is good to have enabled by default. |
Contribution description
When implementing ICMPv6 for GNRC I also added build and send functions for ICMPv6 error messages, but I never actually used them while implementing IPv6. Reviewing that sub-module I found it quite buggy:
This PR fixes those issues. Additionally a call of the send functions is added were appropriate, so GNRC is now able to correctly (but optionally) report to a sender what went wrong. To prevent further degeneration of that module, I activated it for
gnrc_networking
(but also some tests might be nice, which is why I set the WIP label, though the tests can also come as a follow-up IMHO).Testing procedures
I tested this using
examples/gnrc_networking
and scapy. If you get problems receiving you might need to merge #10356 first. The tests are required to be executed in order as commands previously executed in other tests might be a precondition:gnrc_networking
(make suregnrc_icmpv6_error
is included; should be automatically as per this PR) for nativescapy
with root privileges (required to send ethernet frames)scapy:
RIOT:
Linux: Configure route to native instance and set a global source address:
sudo ip a a beef::1 dev tapbr0 sudo ip r a affe::/64 via "<native link-local IPv6 address>" dev tapbr0
RIOT: Configure route to bogus neighbor:
Issues/PRs references
None