diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-10-08 16:59:26 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-11-30 04:37:36 +0100 |
commit | 3ca1fab70a0db80dd0460478ead42c6db284ee7b (patch) | |
tree | 30c74c17b8c634c4ceb67711d20103ca113483f0 /test/test-network | |
parent | sd-dhcp-client: minor simplification (diff) | |
download | systemd-3ca1fab70a0db80dd0460478ead42c6db284ee7b.tar.xz systemd-3ca1fab70a0db80dd0460478ead42c6db284ee7b.zip |
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.
Diffstat (limited to 'test/test-network')
-rw-r--r-- | test/test-network/conf/dhcp-client-with-ipv4ll-with-dhcp-server.network (renamed from test/test-network/conf/dhcp-client-with-ipv4ll-fallback-with-dhcp-server.network) | 2 | ||||
-rw-r--r-- | test/test-network/conf/dhcp-client-with-ipv4ll-without-dhcp-server.network (renamed from test/test-network/conf/dhcp-client-with-ipv4ll-fallback-without-dhcp-server.network) | 2 | ||||
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 12 |
3 files changed, 8 insertions, 8 deletions
diff --git a/test/test-network/conf/dhcp-client-with-ipv4ll-fallback-with-dhcp-server.network b/test/test-network/conf/dhcp-client-with-ipv4ll-with-dhcp-server.network index 9ebdbb4f8d..0455e09b4c 100644 --- a/test/test-network/conf/dhcp-client-with-ipv4ll-fallback-with-dhcp-server.network +++ b/test/test-network/conf/dhcp-client-with-ipv4ll-with-dhcp-server.network @@ -3,5 +3,5 @@ Name=veth99 [Network] DHCP=ipv4 -LinkLocalAddressing=fallback +LinkLocalAddressing=yes IPv6AcceptRA=no diff --git a/test/test-network/conf/dhcp-client-with-ipv4ll-fallback-without-dhcp-server.network b/test/test-network/conf/dhcp-client-with-ipv4ll-without-dhcp-server.network index 5489c62a54..2723e0a273 100644 --- a/test/test-network/conf/dhcp-client-with-ipv4ll-fallback-without-dhcp-server.network +++ b/test/test-network/conf/dhcp-client-with-ipv4ll-without-dhcp-server.network @@ -3,7 +3,7 @@ Name=veth99 [Network] DHCP=ipv4 -LinkLocalAddressing=fallback +LinkLocalAddressing=yes IPv6AcceptRA=no [DHCPv4] diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 688238777d..1262611d28 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -3428,8 +3428,8 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities): 'dhcp-client-use-dns-yes.network', 'dhcp-client-use-domains.network', 'dhcp-client-vrf.network', - 'dhcp-client-with-ipv4ll-fallback-with-dhcp-server.network', - 'dhcp-client-with-ipv4ll-fallback-without-dhcp-server.network', + 'dhcp-client-with-ipv4ll-with-dhcp-server.network', + 'dhcp-client-with-ipv4ll-without-dhcp-server.network', 'dhcp-client-with-static-address.network', 'dhcp-client.network', 'dhcp-server-decline.network', @@ -3995,9 +3995,9 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities): print(output) self.assertRegex(output, 'onlink') - def test_dhcp_client_with_ipv4ll_fallback_with_dhcp_server(self): + def test_dhcp_client_with_ipv4ll_with_dhcp_server(self): copy_unit_to_networkd_unit_path('25-veth.netdev', 'dhcp-server-veth-peer.network', - 'dhcp-client-with-ipv4ll-fallback-with-dhcp-server.network') + 'dhcp-client-with-ipv4ll-with-dhcp-server.network') start_networkd() self.wait_online(['veth-peer:carrier']) start_dnsmasq(lease_time='2m') @@ -4032,9 +4032,9 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities): search_words_in_dnsmasq_log('DHCPOFFER', show_all=True) - def test_dhcp_client_with_ipv4ll_fallback_without_dhcp_server(self): + def test_dhcp_client_with_ipv4ll_without_dhcp_server(self): copy_unit_to_networkd_unit_path('25-veth.netdev', 'dhcp-server-veth-peer.network', - 'dhcp-client-with-ipv4ll-fallback-without-dhcp-server.network') + 'dhcp-client-with-ipv4ll-without-dhcp-server.network') start_networkd() self.wait_online(['veth99:degraded', 'veth-peer:routable']) |