gnrc_ipv6: move ipv6_ext iteration out of ext_demux()#10234
Merged
jia200x merged 6 commits intoRIOT-OS:masterfrom Dec 14, 2018
Merged
gnrc_ipv6: move ipv6_ext iteration out of ext_demux()#10234jia200x merged 6 commits intoRIOT-OS:masterfrom
jia200x merged 6 commits intoRIOT-OS:masterfrom
Conversation
8a4ff3e to
b766b10
Compare
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Oct 23, 2018
5 tasks
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Oct 24, 2018
870a055 to
252540e
Compare
This was referenced Oct 24, 2018
92f18bb to
8029b4f
Compare
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Oct 24, 2018
8029b4f to
90c8cea
Compare
Member
Author
|
Rebased to current #10233 |
Lotterleben
reviewed
Oct 25, 2018
Lotterleben
reviewed
Oct 25, 2018
Lotterleben
reviewed
Oct 25, 2018
82308cd to
b1f1b81
Compare
Member
Author
|
Rebased to current #10233. |
Member
Author
|
Already found the first batch of errors due to my tests :-) |
Member
Author
|
Fixed typo in as squashable commit. |
Member
|
|
Member
|
well, it seems to work. I will run #10229 tests as well |
Member
|
#10229 tests run fine. |
Member
Author
|
May I squash? |
Member
Yes, sure |
Member
|
vera++ doesn't report problems with the introduced changes. There are some consecutive empty lines but not in the scope of this PR. |
Member
Author
|
Squashed |
76256a9 to
d7c4078
Compare
jia200x
requested changes
Dec 13, 2018
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
Member
Author
|
Murdock likes it now :) |
Member
|
Thanks @miri64 ! |
Member
Author
|
Thanks for your review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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_extdoesn't recurse intognrc_ipv6_demux()anymore, that function can be made private again.Testing procedure
I used
scapyto inject packets with and without extension headers into anativeinstance 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)