diff --git a/src/network/networkd-nexthop.c b/src/network/networkd-nexthop.c index ed0a203302..91f0eb3032 100644 --- a/src/network/networkd-nexthop.c +++ b/src/network/networkd-nexthop.c @@ -2,6 +2,7 @@ * Copyright © 2019 VMware, Inc. */ +#include #include #include "alloc-util.h" @@ -695,12 +696,21 @@ static bool nexthop_is_ready_to_configure(Link *link, const NextHop *nexthop) { assert(link); assert(nexthop); + if (!link_is_ready_to_configure(link, false)) + return false; + if (nexthop->blackhole) { if (link->manager->nexthop_remove_messages > 0) return false; } else { Link *l; + /* TODO: fdb nexthop does not require IFF_UP. The condition below needs to be updated + * when fdb nexthop support is added. See rtm_to_nh_config() in net/ipv4/nexthop.c of + * kernel. */ + if (!FLAGS_SET(link->flags, IFF_UP)) + return false; + HASHMAP_FOREACH(l, link->manager->links) { if (l->address_remove_messages > 0) return false; @@ -739,9 +749,6 @@ int request_process_nexthop(Request *req) { assert(req->nexthop); assert(req->type == REQUEST_TYPE_NEXTHOP); - if (!link_is_ready_to_configure(req->link, false)) - return 0; - if (!nexthop_is_ready_to_configure(req->link, req->nexthop)) return 0;