* Copyright © 2019 VMware, Inc.
*/
+#include <net/if.h>
#include <linux/nexthop.h>
#include "alloc-util.h"
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;
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;