* Copyright © 2019 VMware, Inc.
*/
+/* Make sure the net/if.h header is included before any linux/ one */
#include <net/if.h>
#include <linux/nexthop.h>
assert(nexthop->id > 0);
assert(manager);
+ /* If the nexthop is remembered, then use the remembered object. */
+ (void) nexthop_get_by_id(manager, PTR_TO_UINT32(nexthop->id), &nexthop);
+
/* link may be NULL. */
(void) link_get_by_index(manager, nexthop->ifindex, &link);
continue;
/* When 'foreign' is true, mark only foreign nexthops, and vice versa. */
- if (foreign != (nexthop->source == NETWORK_CONFIG_SOURCE_FOREIGN))
+ if (nexthop->source != (foreign ? NETWORK_CONFIG_SOURCE_FOREIGN : NETWORK_CONFIG_SOURCE_STATIC))
continue;
/* Ignore nexthops not assigned yet or already removed. */