summaryrefslogtreecommitdiffstats
path: root/ripngd
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-05-19 04:26:53 +0200
committerRenato Westphal <renato@opensourcerouting.org>2020-05-16 04:47:43 +0200
commit78769ea20595351136cff1fcf3ce0448b0cd4e21 (patch)
treec45a3c8b6bbe1132c029273a66be0d1a088331cf /ripngd
parentzebra: skip link-local routes when iterating over the RIB using the NB (diff)
downloadfrr-78769ea20595351136cff1fcf3ce0448b0cd4e21.tar.xz
frr-78769ea20595351136cff1fcf3ce0448b0cd4e21.zip
zebra: optimize the RIB get_next() callback
When fetching the next route node in the RIB, skip the empty ones to avoid calling other northbound callbacks later unnecessarily. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripngd')
-rw-r--r--ripngd/ripng_nb_state.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ripngd/ripng_nb_state.c b/ripngd/ripng_nb_state.c
index 926573b40..02a00ac42 100644
--- a/ripngd/ripng_nb_state.c
+++ b/ripngd/ripng_nb_state.c
@@ -144,6 +144,7 @@ ripngd_instance_state_routes_route_get_next(struct nb_cb_get_next_args *args)
rn = agg_route_top(ripng->table);
else
rn = agg_route_next((struct agg_node *)args->list_entry);
+ /* Optimization: skip empty route nodes. */
while (rn && rn->info == NULL)
rn = agg_route_next(rn);