]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/network/networkd-address.c
network: allow to configure multiple IPv6 null addresses with different prefix length
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 10 Sep 2023 15:30:14 +0000 (00:30 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 18 Sep 2023 01:22:08 +0000 (10:22 +0900)
commit6174dc7d9612405b853511b277269ba5951e618f
treef5c4d21fe7ce8f090ae505ba64d86b7cfc33a8de
parent381e3cc68b7b58865ba055f90bec84fc899d45d1
network: allow to configure multiple IPv6 null addresses with different prefix length

Previously, even if a .network file contains multiple IPv6 null
addresses with different prefix length, only the first setting is applied,
as the remainings are deduped in network_drop_invalid_addresses().

Even though the kernel allows us to change the prefix length of an existing
IPv6 address, we cannot safely change the prefix length of an address
that is originally requested as a null address, as the prefix of the
address may conflict with other addresses if we change it.

We already prohibit to change the prefix length of an existing IPv6
address that is originally requested as a null address. So, we can
safely allow to configure multiple IPv6 addresses from null addresses by
relaxing the dedup logic. The dedup is govern by the hash_ops. This adds
a special handling for IPv6 null addresses.
src/network/networkd-address.c