-
Notifications
You must be signed in to change notification settings - Fork 2.1k
gnrc_ipv6: move ipv6_ext iteration out of ext_demux() #10234
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_ipv6: move ipv6_ext iteration out of ext_demux() #10234
Conversation
8a4ff3e
to
b766b10
Compare
870a055
to
252540e
Compare
92f18bb
to
8029b4f
Compare
8029b4f
to
90c8cea
Compare
Rebased to current #10233 |
82308cd
to
b1f1b81
Compare
Rebased to current #10233. |
Already found the first batch of errors due to my tests :-) |
Fixed typo in as squashable commit. |
|
well, it seems to work. I will run #10229 tests as well |
#10229 tests run fine. |
May I squash? |
Yes, sure |
vera++ doesn't report problems with the introduced changes. There are some consecutive empty lines but not in the scope of this PR. |
Squashed |
76256a9
to
d7c4078
Compare
Since with RIOT-OS#10233 we now assume IPv6 packets always to not be pre-parsed, we can iterate over the extension headers by gradually "eating" them away. This allows us to move the iteration over them out of `gnrc_ipv6_ext_demux()` and into `gnrc_ipv6_demux()`. By moving the iteration over all extension headers out of `gnrc_ipv6_ext_demux()` we also can 1. simplify the extension header handling a lot, as it now just a loop inside `gnrc_ipv6_demux()`, 2. remove the recursion to `gnrc_ipv6_demux()` within `gnrc_ipv6_ext_demux()`.
As `pkt` isn't pre-parsed the write-protection of *the whole* packet (except the netif-header) comes for free, when this was done in the receive routine of IPv6.
Since the recursion into `gnrc_ipv6_demux()` was removed in `gnrc_ipv6_ext`, `gnrc_ipv6.c` is the only user of this function, so it can be made private. It was only made public so it can be used from `gnrc_ipv6_ext`.
With the preceding changes the subject of the deprecation note on `gnrc_pktbuf_duplicate_upto()` becomes actual and thus doesn't need to be referred to in future but past tense.
d7c4078
to
4257b70
Compare
Murdock likes it now :) |
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
Thanks @miri64 ! |
Thanks for your review! |
Contribution description
Since with #10233 we now assume IPv6 packets always to not be pre-parsed, we can iterate over the extension headers by gradually "eating" them away. This allows us to move the iteration over them out of
gnrc_ipv6_ext_demux()
and intognrc_ipv6_demux()
.By moving the iteration over all extension headers out of
gnrc_ipv6_ext_demux()
we also cangnrc_ipv6_demux()
,gnrc_ipv6_demux()
withingnrc_ipv6_ext_demux()
.I also piggy-backed some follow-up work that are related to demuxing and the fact that they are not pre-parsed:
gnrc_ipv6_ext
doesn't recurse intognrc_ipv6_demux()
anymore, that function can be made private again.Testing procedure
I used
scapy
to inject packets with and without extension headers into anative
instance ofgnrc_networking
:On RIOT:
Within
scapy
(be aware that to send Ethernet frames, root privileges are required, so best start it withsudo scapy
):You can find some documentation on IPv6 extension headers in this document
You can also just redo the testing procedures in #10229.
Issues/PRs references
Depends on #10233 (and its dependencies)