summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-08-21 15:34:19 +0200
committerMark Stapp <mjs@voltanet.io>2020-08-21 15:39:02 +0200
commitf5158712078be06211ad26b1e887209c6b15cab1 (patch)
treec8f432fbea53f7df0cf58479e7016e9afb4f7f90 /zebra/zebra_rib.c
parentMerge pull request #6951 from donaldsharp/zebra_table (diff)
downloadfrr-f5158712078be06211ad26b1e887209c6b15cab1.tar.xz
frr-f5158712078be06211ad26b1e887209c6b15cab1.zip
zebra: fix SA warning in rib_process()
Fix an SA warning about a possible NULL pointer deref in rib_process(). Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to '')
-rw-r--r--zebra/zebra_rib.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index abc3ba5f3..8852ee946 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1028,21 +1028,23 @@ static void rib_process(struct route_node *rn)
if (IS_ZEBRA_DEBUG_RIB)
srcdest_rnode2str(rn, buf, sizeof(buf));
- if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
- struct route_entry *re = re_list_first(&dest->routes);
-
- zlog_debug("%s(%u:%u):%s: Processing rn %p", VRF_LOGNAME(vrf),
- vrf_id, re->table, buf, rn);
- }
-
/*
* we can have rn's that have a NULL info pointer
* (dest). As such let's not let the deref happen
* additionally we know RNODE_FOREACH_RE_SAFE
* will not iterate so we are ok.
*/
- if (dest)
+ if (dest) {
+ if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
+ struct route_entry *re = re_list_first(&dest->routes);
+
+ zlog_debug("%s(%u:%u):%s: Processing rn %p",
+ VRF_LOGNAME(vrf), vrf_id, re->table, buf,
+ rn);
+ }
+
old_fib = dest->selected_fib;
+ }
RNODE_FOREACH_RE_SAFE (rn, re, next) {
if (IS_ZEBRA_DEBUG_RIB_DETAILED)