#define RIB_KERNEL_ROUTE(R) RKERNEL_ROUTE((R)->type)
+/* Define route types that are equivalent to "connected". */
+#define RIB_CONNECTED_ROUTE(R) \
+ ((R)->type == ZEBRA_ROUTE_CONNECT || (R)->type == ZEBRA_ROUTE_NHRP)
+
/* meta-queue structure:
* sub-queue 0: nexthop group objects
* sub-queue 1: EVPN/VxLAN objects
continue;
}
- if ((match->type == ZEBRA_ROUTE_CONNECT) ||
+ /* If the candidate match's type is considered "connected",
+ * we consider it first.
+ */
+ if (RIB_CONNECTED_ROUTE(match) ||
(RIB_SYSTEM_ROUTE(match) && RSYSTEM_ROUTE(type))) {
match = zebra_nhg_connected_ifindex(rn, match,
nexthop->ifindex);
return 0;
}
+ /* NHRP special case: need to indicate onlink */
+ if (match->type == ZEBRA_ROUTE_NHRP)
+ SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK);
+
if (IS_ZEBRA_DEBUG_NHG_DETAIL)
zlog_debug(
"%s: CONNECT match %p (%pNG), newhop %pNHv",