diff options
| author | Jafar Al-Gharaibeh <Jafaral@users.noreply.github.com> | 2017-08-31 10:25:55 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-31 10:25:55 -0500 |
| commit | 959768e8d049303c434bcb67e64d19bae65d073a (patch) | |
| tree | 0387049fc8de44d6a22fafe639f58f6cfb9113f7 /zebra/zebra_rib.c | |
| parent | edfb96d21eb0dc5ad4578d74597bc397e22f6e08 (diff) | |
| parent | 1e9f448fe1b60e464d187c96092d2cf6201e64e1 (diff) | |
Merge pull request #1044 from donaldsharp/combination
Coverity Cleanup of Stuff
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index eecefa09c8..c7a2564ab4 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2726,23 +2726,27 @@ unsigned long rib_score_proto(u_char proto, u_short instance) void rib_close_table(struct route_table *table) { struct route_node *rn; - rib_table_info_t *info = table->info; + rib_table_info_t *info; struct route_entry *re; - if (table) - for (rn = route_top(table); rn; rn = srcdest_route_next(rn)) - RNODE_FOREACH_RE(rn, re) - { - if (!CHECK_FLAG(re->status, - ROUTE_ENTRY_SELECTED_FIB)) - continue; + if (!table) + return; - if (info->safi == SAFI_UNICAST) - hook_call(rib_update, rn, NULL); + info = table->info; - if (!RIB_SYSTEM_ROUTE(re)) - rib_uninstall_kernel(rn, re); - } + for (rn = route_top(table); rn; rn = srcdest_route_next(rn)) + RNODE_FOREACH_RE(rn, re) + { + if (!CHECK_FLAG(re->status, + ROUTE_ENTRY_SELECTED_FIB)) + continue; + + if (info->safi == SAFI_UNICAST) + hook_call(rib_update, rn, NULL); + + if (!RIB_SYSTEM_ROUTE(re)) + rib_uninstall_kernel(rn, re); + } } /* Routing information base initialize. */ |
