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.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 0b1450c8f8..166d479d78 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1378,8 +1378,6 @@ static void zebra_rib_fixup_system(struct route_node *rn)
static bool rib_compare_routes(const struct route_entry *re1,
const struct route_entry *re2)
{
- bool result = false;
-
if (re1->type != re2->type)
return false;
@@ -1393,17 +1391,14 @@ static bool rib_compare_routes(const struct route_entry *re1,
re1->distance != re2->distance)
return false;
- /* Only connected routes need more checking, nexthop-by-nexthop */
+ /* We support multiple connected routes: this supports multiple
+ * v6 link-locals, and we also support multiple addresses in the same
+ * subnet on a single interface.
+ */
if (re1->type != ZEBRA_ROUTE_CONNECT)
return true;
- /* Quick check if shared nhe */
- if (re1->nhe == re2->nhe)
- return true;
-
- result = nexthop_group_equal_no_recurse(&re1->nhe->nhg, &re2->nhe->nhg);
-
- return result;
+ return false;
}
/*
@@ -2268,9 +2263,18 @@ static void process_subq_route(struct listnode *lnode, uint8_t qindex)
rib_process(rnode);
if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
- struct route_entry *re = re_list_first(&dest->routes);
+ struct route_entry *re = NULL;
char buf[SRCDEST2STR_BUFFER];
+ /*
+ * rib_process may have freed the dest
+ * as part of the garbage collection. Let's
+ * prevent stupidity from happening.
+ */
+ dest = rib_dest_from_rnode(rnode);
+ if (dest)
+ re = re_list_first(&dest->routes);
+
srcdest_rnode2str(rnode, buf, sizeof(buf));
zlog_debug("%s(%u:%u):%s: rn %p dequeued from sub-queue %u",
zvrf_name(zvrf), zvrf_id(zvrf), re ? re->table : 0, buf,
@@ -2285,7 +2289,7 @@ static void process_subq_route(struct listnode *lnode, uint8_t qindex)
else
{
zlog_debug ("%s: called for route_node (%p, %d) with no ribs",
- __func__, rnode, rnode->lock);
+ __func__, rnode, route_node_get_lock_count(rnode));
zlog_backtrace(LOG_DEBUG);
}
#endif
@@ -2460,8 +2464,8 @@ int rib_queue_add(struct route_node *rn)
/* Pointless to queue a route_node with no RIB entries to add or remove
*/
if (!rnode_to_ribs(rn)) {
- zlog_debug("%s: called for route_node (%p, %d) with no ribs",
- __func__, (void *)rn, rn->lock);
+ zlog_debug("%s: called for route_node (%p, %u) with no ribs",
+ __func__, (void *)rn, route_node_get_lock_count(rn));
zlog_backtrace(LOG_DEBUG);
return -1;
}