network: rework IPv6 address generation mode#20778
Merged
yuwata merged 23 commits intosystemd:mainfrom Oct 7, 2021
Merged
Conversation
482eb45 to
39017a1
Compare
deb00fc to
a46242b
Compare
a46242b to
93ce770
Compare
poettering
reviewed
Sep 29, 2021
poettering
reviewed
Sep 29, 2021
93ce770 to
e44b7ce
Compare
Member
Author
|
Updated. I split the commits into small parts, and add more commit messages. PTAL. |
e44b7ce to
4f9d67a
Compare
keszybz
reviewed
Oct 6, 2021
Member
keszybz
left a comment
There was a problem hiding this comment.
Looks all reasonable. I can't say I followed all the code logic changes in detail, but I read through them, and didn't see anything suspicious.
In other files, we usually (but not always) place functions in the following order: - network_adjust_xxx(), which applies default or updates settings specified in .network files, - link_xxx_enabled(), which checks if the functionality is enabled, - xxx_new() and xxx_free(), allocator and deallocator for sections, - functions which apply/update/remove configs - validators of section, - conf parsers. This does not change each function, but just changes the order.
See ISO/IEC 9899:TC3 § 6.5.7.3.
Then, the prefixlen is not a multiplier of 8, we need to use in6_addr_prefix_covers(). This also constify the reserved addresses, and rename macros.
Also, rename the function.
Hopefully, the prefix length is usually 64. Previously, if the prefix length is smaller than 64, the result address was undefined.
The token is stored in Network, and the .network file may be applied to multiple links.
…n_type() - drop unused _NONE type, - rename IPv6Token::prefix -> IPv6Token::address, - clear unused part of IPv6Token::address, - use Set, instead of OrderedSet.
Also, downgrade error level, and caller logs the error.
Preparation for later commits. This does not change functionality.
The token is only used by received prefixes through RA.
So, now user can explicitly request EUI-64 algorithm to generate addresses.
Now the setting supports the same syntax as the one in the [IPv6AcceptRA] section.
4f9d67a to
fe2a8b3
Compare
Member
Author
|
@keszybz Thank you for your review. All comments are addressed. Upgrading the green label. |
5 tasks
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.
Closes #20149.
Please review #20226 at first.