networkd: merge ll addressing fallback modes into normal "boolean" values
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 8 Oct 2020 14:59:26 +0000 (16:59 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 30 Nov 2020 03:37:36 +0000 (12:37 +0900)
commit3ca1fab70a0db80dd0460478ead42c6db284ee7b
tree30c74c17b8c634c4ceb67711d20103ca113483f0
parente4dc0845bc26b3a3abec58932bdefe346d879d0f
networkd: merge ll addressing fallback modes into normal "boolean" values

They are not really boolean, because we have both ipv4 and ipv6, but
for each protocol we have either unset, no, and yes.

From https://github.com/systemd/systemd/issues/13316#issuecomment-582906817:
LinkLocalAddressing must be a boolean option, at least for ipv4:
- LinkLocalAddressing=no => no LL at all.

- LinkLocalAddressing=yes + Static Address => invalid configuration, warn and
  interpret as LinkLocalAddressing=no, no LL at all.

(we check that during parsing and reject)

- LinkLocalAddressing=yes + DHCP => LL process should be subordinated to the
  DHCP one, an LL address must be acquired at start or after a short N
  unsuccessful DHCP attemps, and must not stop DHCP to keeping trying. When a
  DHCP address is acquired, drop the LL address. If the DHCP address is lost,
  re-adquire a new LL address.

(next patch will move in this direction)

- LinkLocalAddressing=fallback has no reason to exist, because LL address must
  always be allocated as a fallback option when using DHCP. Having both DHCP
  and LL address at the same time is an RFC violation, so
  LinkLocalAdressing=yes correctly implemented is already the "fallback"
  behavior. The fallback option must be deprecated and if present in older
  configs must be interpreted as LinkLocalAddressing=yes.

(removed)

- And for IPv6, the LinkLocalAddress option has any sense at all? IPv6-LL
  address aren't required to be always set for every IPv6 enabled interface (in
  this case, coexisting with static or dynamic address if any)? Shouldn't be
  always =yes?

(good question)

This effectively reverts 29e81083bd2fcb2dbf83f67ef358c7d25adf7e9d. There is no
special "fallback" mode now, so the check doesn't make sense anymore.
14 files changed:
man/systemd.network.xml
src/basic/string-table.h
src/network/networkd-dhcp4.c
src/network/networkd-ipv4ll.c
src/network/networkd-link.c
src/network/networkd-link.h
src/network/networkd-network.c
src/network/networkd-util.c
src/network/networkd-util.h
test/test-network/conf/dhcp-client-with-ipv4ll-fallback-with-dhcp-server.network [deleted file]
test/test-network/conf/dhcp-client-with-ipv4ll-fallback-without-dhcp-server.network [deleted file]
test/test-network/conf/dhcp-client-with-ipv4ll-with-dhcp-server.network [new file with mode: 0644]
test/test-network/conf/dhcp-client-with-ipv4ll-without-dhcp-server.network [new file with mode: 0644]
test/test-network/systemd-networkd-tests.py