return r;
}
-int link_drop_managed_addresses(Link *link) {
+int link_drop_static_addresses(Link *link) {
Address *address;
int r = 0;
assert(link);
SET_FOREACH(address, link->addresses) {
- /* Do not touch addresses managed by kernel or other tools. */
- if (address->source == NETWORK_CONFIG_SOURCE_FOREIGN)
+ /* Remove only static addresses here. Dynamic addresses will be removed e.g. on lease
+ * expiration or stopping the DHCP client. */
+ if (address->source != NETWORK_CONFIG_SOURCE_STATIC)
continue;
/* Ignore addresses not assigned yet or already removing. */