]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/network/networkd-ndisc.c
network: compare addresses more strictly
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 22 Feb 2022 19:10:51 +0000 (04:10 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 23 Feb 2022 21:30:37 +0000 (06:30 +0900)
commit5d0030310c134a016321ad8cf0b4ede8b1800d84
treea0ef8b04d186880900cebff1470ba4bb0d35effe
parent0802f62efc1d1c67d5be67223b529c93536cf2ed
network: compare addresses more strictly

This re-introduce the full hash and compre functions for Address,
which was reverted 1d30fc5cb64ecba2f03fe42aa0d8c65c3decad82 (#17851).

The issue #17831, which is fixed by #17851, is handled in a different way;
simply ignore to configure the conflicted DHCPv6 address. Previously, we
warn about the conflict, but continue to configure the address anyway, and
the kernel ignores the request. So, it is not necessary to request the
conflicted address in networkd side.

This fixes the following issues:
- when a link has an address, and corresponding .network file has the
  address with different prefix length, then the prefix length specified
  in the .network file will not be applied,
- we cannot specify multiple IPv4 addresses with different prefix
  length, e.g.
  ----
  Address=10.10.10.10/24
  Address=10.10.10.10/16
  ----
  This is spurious setup, but the kernel allows it.

Fixes #22515.
src/network/networkd-address.c
src/network/networkd-address.h
src/network/networkd-dhcp6.c
src/network/networkd-ndisc.c
src/network/test-network.c