Merge pull request #17474 from yuwata/network-drop-link-deserialization-logic
network: drop link deserialization logic
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user