diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-11-27 09:08:01 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-27 09:08:01 +0900 |
commit | dca63b5b46f36989f69b154d7af3b4da433ae59e (patch) | |
tree | 9ce43d3630e029a3a53a1fb3821bc337523b4d3f /src/network/networkd-sysctl.c | |
parent | 0d5eb02134c6420a7b929915df5a1b18ba841911 (diff) | |
parent | 61eb77c4b6784ca3244dbbc0f292e051f18eab71 (diff) | |
download | systemd-dca63b5b46f36989f69b154d7af3b4da433ae59e.tar.gz |
Merge pull request #17474 from yuwata/network-drop-link-deserialization-logic
network: drop link deserialization logic
Diffstat (limited to 'src/network/networkd-sysctl.c')
-rw-r--r-- | src/network/networkd-sysctl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/network/networkd-sysctl.c b/src/network/networkd-sysctl.c index 518fe8e131..add069e470 100644 --- a/src/network/networkd-sysctl.c +++ b/src/network/networkd-sysctl.c @@ -212,6 +212,15 @@ int link_set_sysctl(Link *link) { if (r < 0) log_link_warning_errno(link, r, "Cannot set IPv4 accept_local flag for interface, ignoring: %m"); + /* If promote_secondaries is not set, DHCP will work only as long as the IP address does not + * changes between leases. The kernel will remove all secondary IP addresses of an interface + * otherwise. The way systemd-networkd works is that the new IP of a lease is added as a + * secondary IP and when the primary one expires it relies on the kernel to promote the + * secondary IP. See also https://github.com/systemd/systemd/issues/7163 */ + r = sysctl_write_ip_property_boolean(AF_INET, link->ifname, "promote_secondaries", true); + if (r < 0) + log_link_warning_errno(link, r, "Cannot enable promote_secondaries for interface, ignoring: %m"); + return 0; } |