Skip to content

network: Allow to specify multiple IPv6Token for SLAAC - #14415

Merged
keszybz merged 2 commits into
systemd:masterfrom
ssahani:prefixstable-rfc-7217-new
Feb 5, 2020
Merged

keszybz merged 2 commits into
systemd:masterfrom
ssahani:prefixstable-rfc-7217-new

Conversation

@ssahani

@ssahani ssahani commented Dec 21, 2019

Copy link
Copy Markdown
Contributor

Provide names to choose between different auto-generation types:
2.1 "eui64" for EUI-64 of RFC 4291
2.2 "prefixstable" for RFC 7217

[Match]
Name=veth99

[Network]
DHCP=no
IPv6AcceptRA=yes
IPv6Token=prefixstable:2001:888:0db8:1::/64

closes #6889

@poettering

Copy link
Copy Markdown
Member

looks pretty good to me from a superficial review. I'll leave it to @yuwata to merge though.

@ssahani

ssahani commented Jan 8, 2020

Copy link
Copy Markdown
Contributor Author

Ping @yuwata

Comment thread src/network/networkd-ndisc.c Outdated
Comment thread src/network/networkd-ndisc.c Outdated
Comment thread src/network/networkd-ndisc.c Outdated
@yuwata yuwata added the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Jan 9, 2020
@ssahani
ssahani force-pushed the prefixstable-rfc-7217-new branch from 3a964d5 to f2ebf4d Compare January 9, 2020 12:24
@ssahani

ssahani commented Jan 9, 2020

Copy link
Copy Markdown
Contributor Author

Updated thanks for the review @poettering @yuwata

@yuwata

yuwata commented Jan 9, 2020

Copy link
Copy Markdown
Member

LGTM. I will test this later.

@yuwata yuwata left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry, one more round.

Comment thread src/network/networkd-ndisc.c Outdated
Comment thread src/network/networkd-ndisc.c Outdated
Comment thread src/network/networkd-ndisc.c Outdated
Comment thread src/network/networkd-ndisc.c Outdated
@ssahani
ssahani force-pushed the prefixstable-rfc-7217-new branch from f2ebf4d to 4a85ac8 Compare January 13, 2020 05:01
@ssahani

ssahani commented Jan 13, 2020

Copy link
Copy Markdown
Contributor Author

updated thanks @yuwata

@yuwata

yuwata commented Jan 13, 2020

Copy link
Copy Markdown
Member

LGTM. I will test this later.

@yuwata
yuwata force-pushed the prefixstable-rfc-7217-new branch from 4a85ac8 to 6e8c031 Compare January 26, 2020 12:19
@yuwata yuwata removed the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Jan 26, 2020
@yuwata

yuwata commented Jan 26, 2020 •

Copy link
Copy Markdown
Member

@ssahani Updated. Fixed several errors in ipv6_makestableprivate(), and added a test case. PTAL.

(And sorry for late to test this.)

@ssahani

ssahani commented Jan 26, 2020 •

Copy link
Copy Markdown
Contributor Author

I am not sure not able to compile from couple of days

ninja -C build
ninja: Entering directory `build'
[29/101] Generating systemd_boot.so with a custom command.
FAILED: src/boot/efi/systemd_boot.so 
/usr/bin/ld -o src/boot/efi/systemd_boot.so -T /usr/lib64/gnuefi/elf_x64_efi.lds -shared -Bsymbolic -nostdlib -znocombreloc -L /usr/lib64 /usr/lib64/gnuefi/crt0-efi-x64.o src/boot/efi/disk.c.o src/boot/efi/graphics.c.o src/boot/efi/measure.c.o src/boot/efi/pe.c.o src/boot/efi/util.c.o src/boot/efi/boot.c.o src/boot/efi/console.c.o src/boot/efi/crc32.c.o src/boot/efi/random-seed.c.o src/boot/efi/sha256.c.o src/boot/efi/shim.c.o -lefi -lgnuefi /usr/lib/gcc/x86_64-redhat-linux/10/libgcc.a
/usr/bin/ld: src/boot/efi/graphics.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/pe.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/util.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/boot.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/console.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/random-seed.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of  loader_guid src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/shim.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
[31/101] Generating splash.c.o with a custom command.
ninja: build stopped: subcommand failed.
make: *** [Makefile:2: all] Error 1

Comment thread test/test-network/systemd-networkd-tests.py Outdated
@yuwata
yuwata force-pushed the prefixstable-rfc-7217-new branch from 6e8c031 to cd1d682 Compare January 26, 2020 14:13
@ssahani

ssahani commented Jan 26, 2020

Copy link
Copy Markdown
Contributor Author

Lgtm

@yuwata yuwata added the 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 label Jan 26, 2020
@yuwata

yuwata commented Jan 26, 2020 •

Copy link
Copy Markdown
Member

This needs #14670. I will force-push this after #14670 is merged to restart the CIs.

@yuwata
yuwata force-pushed the prefixstable-rfc-7217-new branch from cd1d682 to 1a2aa72 Compare January 28, 2020 14:36
@yuwata

yuwata commented Jan 28, 2020

Copy link
Copy Markdown
Member

hmmmm??

Jan 28 16:30:10 arch.localdomain systemd-networkd[34251]: Failed to get machine id: Operation not supported
Jan 28 16:30:10 arch.localdomain systemd-networkd[34251]: veth99: Falied to generate prefix stable address: Operation not supported

@yuwata

yuwata commented Jan 28, 2020

Copy link
Copy Markdown
Member

Ah,

RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6 AF_PACKET

@mrc0mmand Is it possible to update the unit file systemd-networkd.service? Please see #14670.

mrc0mmand added a commit to systemd/systemd-centos-ci that referenced this pull request Jan 28, 2020
@mrc0mmand

Copy link
Copy Markdown
Member

Ah,

RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6 AF_PACKET

@mrc0mmand Is it possible to update the unit file systemd-networkd.service? Please see #14670.

Should be fixed by systemd/systemd-centos-ci@0a37f42. I re-triggered both failing jobs, but it may take a while, as there's already a queue of running jobs.

@yuwata

yuwata commented Jan 28, 2020

Copy link
Copy Markdown
Member

@mrc0mmand Thanks!

Comment thread src/network/networkd-ndisc.c Outdated
Comment thread src/network/networkd-ndisc.c Outdated
Comment thread src/network/networkd-ndisc.c Outdated
Comment thread src/network/networkd-ndisc.c Outdated
@poettering poettering removed the 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 label Jan 28, 2020
@poettering poettering added the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Jan 28, 2020
@yuwata
yuwata force-pushed the prefixstable-rfc-7217-new branch from 1a2aa72 to 3a23d22 Compare January 30, 2020 08:31
@yuwata

yuwata commented Jan 30, 2020

Copy link
Copy Markdown
Member

@poettering Thank you for the comments. Updated. PTAL.

@yuwata yuwata removed the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Jan 30, 2020
@yuwata
yuwata force-pushed the prefixstable-rfc-7217-new branch from 3a23d22 to 47723b0 Compare February 3, 2020 08:00
@yuwata

yuwata commented Feb 3, 2020

Copy link
Copy Markdown
Member

Rebased.

@yuwata

yuwata commented Feb 3, 2020

Copy link
Copy Markdown
Member

@keszybz Could you review this? We already addressed all suggestions by @poettering.

@yuwata yuwata added this to the v245 milestone Feb 5, 2020
@yuwata
yuwata force-pushed the prefixstable-rfc-7217-new branch from 47723b0 to 8607ad6 Compare February 5, 2020 06:24
@yuwata

yuwata commented Feb 5, 2020

Copy link
Copy Markdown
Member

Rebased again. @keszybz PTAL.

@keszybz keszybz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks pretty OK in general...

Comment thread src/network/networkd-ndisc.c Outdated
Comment thread src/network/networkd-ndisc.c Outdated
Comment thread man/systemd.network.xml Outdated
Comment thread src/network/networkd-ndisc.c Outdated
Comment thread src/network/networkd-ndisc.c Outdated
Comment thread src/network/networkd-ndisc.c Outdated
ssahani and others added 2 commits February 5, 2020 17:44
Provide names to choose between different auto-generation types:
2.1 "eui64" for EUI-64 of RFC 4291
2.2 "prefixstable" for RFC 7217

```
[Match]
Name=veth99

[Network]
DHCP=no
IPv6AcceptRA=yes
IPv6Token=prefixstable:2001:888:0db8:1::
```
@yuwata
yuwata force-pushed the prefixstable-rfc-7217-new branch from 8607ad6 to 87bbebe Compare February 5, 2020 08:45
@yuwata

yuwata commented Feb 5, 2020

Copy link
Copy Markdown
Member

@keszybz Thank you for the review. All points are addressed. PTAL.

@keszybz

keszybz commented Feb 5, 2020

Copy link
Copy Markdown
Member

Thanks, LGTM.

@keszybz keszybz added the 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 label Feb 5, 2020
@keszybz
keszybz merged commit 5bbcff2 into systemd:master Feb 5, 2020
Comment thread man/systemd.network.xml
the token is only ever used for SLAAC, and not for DHCPv6 addresses, even
in the case DHCP is requested by router advertisement. By default, the
token is autogenerated.</para>
<para>Specifies an optional address generation mechanism and an optional address prefix. If

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This documentation is somewhat confusing to me; when eui64 mode is used, the supplied address is not a prefix, it's a suffix. Unless someone is already working on it, I'd be happy to send a PR to improve the documentation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please do.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As I read through the code my confusion is growing... as this 'eui64' mode replaces the existing unnamed 'static' mode where the user supplies the token (which may or may not have been generated using the EUI-64 mechanism). This is even evident in the eui64 test case, where a static token is supplied which is almost certainly not a valid EUI-64 Interface Identifer, but it is treated as such in the code.

Unless I'm mistaken, there should be three modes:

  • static - user supplies the lowest 64 bits of address, generated in any fashion they wish
  • eui64 - user does not (and cannot) supply an address but explicitly requests that an EUI-64 IiD be generated
  • prefixstable - user supplies a prefix (of varying length) and an RFC7217 IID is generated

I know I'm coming into this discussion quite late and the PR has already been merged, but I'm currently a happy user of the 'static' mode and I wouldn't want anyone to use the 'eui64' label for that mode, or for any diagnostic or error messages to refer to 'eui64' mode when I didn't request it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I will take a look later.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@yuwata yuwata removed the 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 label Feb 6, 2020
@ssahani
ssahani deleted the prefixstable-rfc-7217-new branch February 7, 2020 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

systemd-network: IPv6Token/RFE: Multiple Definitions, Named Auto-Generation Types, Per-Prefix Definition, Anycast/NoDAD

6 participants