gnrc_ipv6: assume no preparsed packets#10233
Merged
jia200x merged 3 commits intoRIOT-OS:masterfrom Dec 10, 2018
Merged
Conversation
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Oct 23, 2018
5 tasks
b5d3471 to
eee483e
Compare
miri64
commented
Oct 23, 2018
| static void _receive(gnrc_pktsnip_t *pkt) | ||
| { | ||
| gnrc_netif_t *netif = NULL; | ||
| gnrc_pktsnip_t *ipv6, *netif_hdr, *first_ext; |
Member
Author
There was a problem hiding this comment.
Due to pkt now only consisting of the IPv6 header (and possibly the netif header), with the IPv6 header later being marked (i.e. the packet becomes payload -> ipv6 -> netif), first_ext became only an alias for pkt and this unnecessary.
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Oct 23, 2018
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Oct 23, 2018
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Oct 23, 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()`.
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Oct 23, 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()`.
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Oct 24, 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()`.
a943d97 to
3a564fb
Compare
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Oct 24, 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()`.
b0d3dca to
36f6265
Compare
Member
Author
|
Rebased to current #10229. |
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Oct 25, 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()`.
36f6265 to
e9b1aef
Compare
Member
Author
|
Rebased to current #10229. |
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Oct 29, 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()`.
Member
Author
|
Reminder to self: adapt for ugly bugfix in #10246. |
3208262 to
bea82a9
Compare
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Nov 14, 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()`.
bea82a9 to
8ed76a8
Compare
Member
Author
|
Rebased to current #10229. |
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Nov 17, 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()`.
Since the packet is now guaranteed to be preparsed, the currently handled IPv6 header will always be in the first snip. Because of this the packet parser can't get confused anymore which IPv6 header is the one to be handled so we don't need to remove the more outer ones. Because of this we can just use the normal packet dispatching (which is already used by other `GNRC_NETTYPE_*`-known protocol numbers such as UDP). This also reverts d54ac38.
8ed76a8 to
3fde0ef
Compare
Member
Author
|
Rebased to current master. No longer waiting on other PR. |
Member
|
Tested with the described procedure (and also with the one in #10229 ) |
Member
|
nothing interesting to report on coding style and documentation doesn't apply here |
Member
|
btw it reduces around 800 bytes on samr21-xpro when rebased to master :) |
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
Dec 10, 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()`.
miri64
added a commit
to miri64/RIOT
that referenced
this pull request
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()`.
crest42
pushed a commit
to crest42/RIOT
that referenced
this pull request
Dec 18, 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()`.
BytesGalore
pushed a commit
to BytesGalore/RIOT
that referenced
this pull request
Jan 29, 2019
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()`.
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
As stated in #10229, with #9484 and #10229 we don't have to assume anymore that an IPv6 packet was preparsed before it is handed to IPv6's receive routine. This allows us to remove a whole chunk of code.
Further simplifications not related to finding the IPv6 header in a preparsed packet will follow later.
Testing procedure
Compile
gnrc_networkingfor a IEEE802.15.4-equipped board of your choice and flash. Try to send IPHC-compressed UDP packets and fragmented packets. All should be received and handled correctly. Here is what I did to test (oniotlab-m3:Also repeat testing proceedures from #10229.
Issues/PRs references
Depends on
#10229 (and its dependencies)(merged).