Skip to content

network: rework IPv6 address generation mode#20778

Merged
yuwata merged 23 commits intosystemd:mainfrom
yuwata:network-ipv6-token
Oct 7, 2021
Merged

network: rework IPv6 address generation mode#20778
yuwata merged 23 commits intosystemd:mainfrom
yuwata:network-ipv6-token

Conversation

@yuwata
Copy link
Member

@yuwata yuwata commented Sep 17, 2021

Closes #20149.

Please review #20226 at first.

@yuwata yuwata added the network label Sep 17, 2021
@yuwata yuwata force-pushed the network-ipv6-token branch 6 times, most recently from 482eb45 to 39017a1 Compare September 24, 2021 12:47
@yuwata yuwata force-pushed the network-ipv6-token branch 2 times, most recently from deb00fc to a46242b Compare September 27, 2021 13:21
@yuwata yuwata marked this pull request as ready for review September 29, 2021 15:10
@poettering poettering added reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks and removed please-review labels Sep 30, 2021
@yuwata yuwata force-pushed the network-ipv6-token branch from 93ce770 to e44b7ce Compare October 1, 2021 12:47
@yuwata yuwata added please-review and removed reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks labels Oct 1, 2021
@yuwata
Copy link
Member Author

yuwata commented Oct 1, 2021

Updated. I split the commits into small parts, and add more commit messages. PTAL.

Copy link
Member

@keszybz keszybz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

yuwata added 4 commits October 7, 2021 01:02
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.
yuwata added 19 commits October 7, 2021 01:03
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.
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.
@yuwata yuwata force-pushed the network-ipv6-token branch from 4f9d67a to fe2a8b3 Compare October 6, 2021 16:27
@yuwata
Copy link
Member Author

yuwata commented Oct 6, 2021

@keszybz Thank you for your review. All comments are addressed. Upgrading the green label.

@yuwata yuwata added good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed and removed good-to-merge/with-minor-suggestions labels Oct 6, 2021
@yuwata yuwata merged commit 6830c3a into systemd:main Oct 7, 2021
@yuwata yuwata deleted the network-ipv6-token branch October 7, 2021 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed network

Development

Successfully merging this pull request may close these issues.

networkd: [IPv6Prefix] Assign= option does not respect [Network] IPv6Token= option

3 participants