Route *route;
assert(link);
+ assert(link->manager);
assert(address);
if (address->lifetime_preferred_usec != USEC_INFINITY)
/* 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. */
- SET_FOREACH(route, link->routes) {
+ SET_FOREACH(route, link->manager->routes) {
if (route->source != NETWORK_CONFIG_SOURCE_FOREIGN)
continue;
if (route->protocol != RTPROT_DHCP)
continue;
+ if (route->nexthop.ifindex != link->ifindex)
+ continue;
+
if (address->family != route->family)
continue;