diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2020-05-18 23:26:53 -0300 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2020-05-15 23:47:43 -0300 |
| commit | 78769ea20595351136cff1fcf3ce0448b0cd4e21 (patch) | |
| tree | c45a3c8b6bbe1132c029273a66be0d1a088331cf /ripngd/ripng_nb_state.c | |
| parent | 9b4d578f4118ef85ddb1afc5d01ddbcec7e3cce1 (diff) | |
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/ripng_nb_state.c')
| -rw-r--r-- | ripngd/ripng_nb_state.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ripngd/ripng_nb_state.c b/ripngd/ripng_nb_state.c index 926573b407..02a00ac429 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); |
