-
Notifications
You must be signed in to change notification settings - Fork 499
[feature] Fix #1095 #1104 Implement full IPv4 header and fragmentation #1108
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
Draft
aaronddavies
wants to merge
8
commits into
smoltcp-rs:main
Choose a base branch
from
aaronddavies:adavies/1095-implement-full-ipv4-header
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[feature] Fix #1095 #1104 Implement full IPv4 header and fragmentation #1108
aaronddavies
wants to merge
8
commits into
smoltcp-rs:main
from
aaronddavies:adavies/1095-implement-full-ipv4-header
Conversation
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
* add dscp and ecn fields and parse them * update an instantiation * claude assisted global fill in * update unit test with non-zero values to parse * add remaining fixed fields * wip - add to all instances * fix doc test * fix dont frag flag in tests * update emit for all fields * fix icmp test * update bench test * fix whitespace
* preserve header length field * add options field to ipv4 repr * update emit function * add raw socket test * add raw socket tx test * update bench test * if guard * make options optional * guard options copy if no options are present * Revert "guard options copy if no options are present" This reverts commit 183d062. * Revert "make options optional" This reverts commit 556c5c8. * address comments on constants * keep header len interface as usize * cargo fmt * clean up vector size in unit test and remove unneeded constant * verify recv queue bytes in test * add set options method to repr and clean up raw tx unit test * improve interface between ipv4 packet and repr * constant for header alignment --------- Co-authored-by: Jeffrey Moon <[email protected]>
Co-authored-by: Adam Michalik <[email protected]>
…#6) * add options len function * wip - implement options frag filter * some cleanup * add guard against no options, add comments * filter options after first packet is sent * fix stream id option example in test * first filter test * test one option plus fixes * add bad option test * add discarded option test * add more tests * add comments * simplify type octet parse * fix obsolete ipv4repr construct in test * cargo fmt * add tx frag option test * fix magic numbers * cargo fmt * clean up tests * comment * fix bad assumption of incoming option alignment and only add padding at end * use enums for option type parsing result * remove magic numbers * format * comment clean up * use match * update comment * tie guards to actual array bounds * prevent possible panic from bad octet with unit test * clean up * remove unnecessary zeroing * add garbage test * multifragment test * test options reassembly of out of order packets * update comments * cargo fmt * drop packet if option filtering fails * update existing tests with fixes * adjust test title * add test to verify message with bad option is never sent * update comment * cargo fmt * rustic fixes
* update rx test with options - fixme - fails * capture complete set of options in fragment buffer * cargo fmt * fix copy * drop packet on option error
* add options len function * wip - implement options frag filter * some cleanup * add guard against no options, add comments * filter options after first packet is sent * fix stream id option example in test * first filter test * test one option plus fixes * add bad option test * add discarded option test * add more tests * add comments * simplify type octet parse * fix obsolete ipv4repr construct in test * cargo fmt * add tx frag option test * fix magic numbers * cargo fmt * clean up tests * comment * fix bad assumption of incoming option alignment and only add padding at end * use enums for option type parsing result * remove magic numbers * format * comment clean up * update rx test with options - fixme - fails * capture complete set of options in fragment buffer * cargo fmt * fix copy * drop packet on option error * fix tests that dont require fragmentation support * ipv4 import fixes and ipvx config if block * import wisely * repr wisely * fragment wisely * format * fix warnings * fix merge error * fix semantic issue introduced in 1095-fragment-options but not detected until ci.sh could be run in thie branch * fix merge error causing redundant `as`
…ht octets (#10) * impl * test * fix missing adjustment * coalesce jeff's version - tests dont work yet * remove argument * remove non-applicable test * add max fragment size test * only add ethernet header length if ethernet is medium * clean up * format * ci test fixes * update comment * updated option fragment filter test * fix merge error
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1108 +/- ##
==========================================
+ Coverage 80.45% 80.96% +0.50%
==========================================
Files 81 81
Lines 24461 24951 +490
==========================================
+ Hits 19681 20202 +521
+ Misses 4780 4749 -31 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Fixes #1095 and #1104.
Changes to operational code:
Ipv4Reprstruct so that they are no longer dropped when message traffic goes through smoltcp.options. This implemented as a fixed size byte array to theIPv4Reprstruct. The header length field determines how many bytes of the options array are to be included when emitting from the struct. Bench tests showed that a the raw array had better performance than usingOption<[u8]>.Changes to unit tests:
IpvXstruct reprNOTE: This PR builds on #1094 and so those changes are also incorporated.
Reference:
Bench tests before & after