summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 5e0baf807d..791f319120 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -449,9 +449,15 @@ static int nexthop_active(afi_t afi, struct route_entry *re,
while (rn) {
route_unlock_node(rn);
- /* If lookup self prefix return immediately. */
- if (rn == top)
- return 0;
+ /* Lookup should halt if we've matched against ourselves ('top',
+ * if specified) - i.e., we cannot have a nexthop NH1 is
+ * resolved by a route NH1. The exception is if the route is a
+ * host route.
+ */
+ if (top && rn == top)
+ if (((afi == AFI_IP) && (rn->p.prefixlen != 32)) ||
+ ((afi == AFI_IP6) && (rn->p.prefixlen != 128)))
+ return 0;
/* Pick up selected route. */
/* However, do not resolve over default route unless explicitly
@@ -1022,6 +1028,14 @@ int rib_install_kernel(struct route_node *rn, struct route_entry *re,
}
}
+ /*
+ * If this is a replace to a new RE let the originator of the RE
+ * know that they've lost
+ */
+ if (old && old != re)
+ zsend_route_notify_owner(old->type, old->instance,
+ old->vrf_id, p,
+ ZAPI_ROUTE_BETTER_ADMIN_WON);
/*
* Make sure we update the FPM any time we send new information to
@@ -1042,7 +1056,11 @@ int rib_install_kernel(struct route_node *rn, struct route_entry *re,
else
UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
}
- }
+ zsend_route_notify_owner(re->type, re->instance, re->vrf_id,
+ p, ZAPI_ROUTE_INSTALLED);
+ } else
+ zsend_route_notify_owner(re->type, re->instance, re->vrf_id,
+ p, ZAPI_ROUTE_FAIL_INSTALL);
return ret;
}