return;
memset(&api, 0, sizeof(api));
- if (fabricd)
- api.flags |= ZEBRA_FLAG_ONLINK;
api.vrf_id = VRF_DEFAULT;
api.type = PROTO_TYPE;
api.safi = SAFI_UNICAST;
if (count >= MULTIPATH_NUM)
break;
api_nh = &api.nexthops[count];
+ if (fabricd)
+ api_nh->onlink = true;
api_nh->vrf_id = VRF_DEFAULT;
/* FIXME: can it be ? */
if (nexthop->ip.s_addr != INADDR_ANY) {
}
api_nh = &api.nexthops[count];
+ if (fabricd)
+ api_nh->onlink = true;
api_nh->vrf_id = VRF_DEFAULT;
api_nh->gate.ipv6 = nexthop6->ip6;
api_nh->ifindex = nexthop6->ifindex;
stream_putl(s, api_nh->vrf_id);
stream_putc(s, api_nh->type);
+ stream_putc(s, api_nh->onlink);
switch (api_nh->type) {
case NEXTHOP_TYPE_BLACKHOLE:
stream_putc(s, api_nh->bh_type);
STREAM_GETL(s, api_nh->vrf_id);
STREAM_GETC(s, api_nh->type);
+ STREAM_GETC(s, api_nh->onlink);
switch (api_nh->type) {
case NEXTHOP_TYPE_BLACKHOLE:
STREAM_GETC(s, api_nh->bh_type);
enum nexthop_types_t type;
vrf_id_t vrf_id;
ifindex_t ifindex;
+ bool onlink;
union {
union g_addr gate;
enum blackhole_type bh_type;
* route entry. This mainly is used for backup static routes.
*/
#define ZEBRA_FLAG_RR_USE_DISTANCE 0x40
-/*
- * This flag tells Zebra that the passed down route is ONLINK and the
- * kernel install flag for it should be turned on
- */
-#define ZEBRA_FLAG_ONLINK 0x80
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK 0x7f000001 /* Internet address 127.0.0.1. */
memcpy(&api.src_prefix, src_pp, sizeof(api.src_prefix));
}
SET_FLAG(api.flags, ZEBRA_FLAG_RR_USE_DISTANCE);
- if (si_changed->onlink)
- SET_FLAG(api.flags, ZEBRA_FLAG_ONLINK);
SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP);
if (si_changed->distance) {
SET_FLAG(api.message, ZAPI_MESSAGE_DISTANCE);
continue;
api_nh->vrf_id = si->nh_vrf_id;
+ api_nh->onlink = si->onlink;
+
switch (si->type) {
case STATIC_IFNAME:
if (si->ifindex == IFINDEX_INTERNAL)
XFREE(MTYPE_RE, re);
return;
}
+ if (api_nh->onlink)
+ SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK);
+
/* MPLS labels for BGP-LU or Segment Routing */
if (CHECK_FLAG(api.message, ZAPI_MESSAGE_LABEL)
&& api_nh->type != NEXTHOP_TYPE_IFINDEX
There was a crash because ifp here was coming to be NULL */
if (ifp)
if (connected_is_unnumbered(ifp)
- || CHECK_FLAG(re->flags, ZEBRA_FLAG_EVPN_ROUTE)
- || CHECK_FLAG(re->flags, ZEBRA_FLAG_ONLINK)) {
+ || CHECK_FLAG(re->flags, ZEBRA_FLAG_EVPN_ROUTE)) {
SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK);
}
nexthop->type = NEXTHOP_TYPE_IPV6_IFINDEX;
nexthop->gate.ipv6 = *ipv6;
nexthop->ifindex = ifindex;
- if (CHECK_FLAG(re->flags, ZEBRA_FLAG_EVPN_ROUTE)
- || CHECK_FLAG(re->flags, ZEBRA_FLAG_ONLINK)) {
+ if (CHECK_FLAG(re->flags, ZEBRA_FLAG_EVPN_ROUTE))
SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK);
- }
route_entry_nexthop_add(re, nexthop);
*/
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK)) {
ifp = if_lookup_by_index(nexthop->ifindex, nexthop->vrf_id);
- if ((ifp && connected_is_unnumbered(ifp))
- || CHECK_FLAG(re->flags, ZEBRA_FLAG_ONLINK)) {
+ if (!ifp) {
+ if (IS_ZEBRA_DEBUG_RIB_DETAILED)
+ zlog_debug(
+ "\t%s: Onlink and interface: %u[%u] does not exist",
+ __PRETTY_FUNCTION__, nexthop->ifindex,
+ nexthop->vrf_id);
+ return 0;
+ }
+ if (connected_is_unnumbered(ifp)) {
if (if_is_operative(ifp))
return 1;
else {
__PRETTY_FUNCTION__, ifp->name);
return 0;
}
- } else {
+ }
+ if (!if_is_operative(ifp)) {
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
zlog_debug(
"\t%s: Interface %s is not unnumbered",