if (address->lifetime_preferred_usec != USEC_INFINITY)
return true;
+ /* There is no way to drtermine if the IPv6 address is dynamic when the lifetime is infinity. */
+ if (address->family != AF_INET)
+ return false;
+
/* Even when the address is leased from a DHCP server, networkd assign the address
* without lifetime when KeepConfiguration=dhcp. So, let's check that we have
* corresponding routes with RTPROT_DHCP. */
if (route->source != NETWORK_CONFIG_SOURCE_FOREIGN)
continue;
- /* The route is not assigned yet, or already removed. Ignoring. */
+ /* The route is not assigned yet, or already being removed. Ignoring. */
if (!route_exists(route))
continue;