summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-01-02 09:09:09 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-01-02 09:12:07 -0500
commit607425e5544a3f3afbb4d9b811e62433daf2c691 (patch)
tree5c3b32691712d14546dd8318fac47d3a4a1bc502 /zebra/zebra_rib.c
parentff99c5b2bb523560108f68f9251dcd93a1b9d7ee (diff)
zebra: Fix dest dereference
The rn can not have an rn->info pointer and as such the dest may be NULL. Don't assign the old_fib pointer if so. This is ok because we know RNODE_FOREACH... will not iterate if dest is NULL. Fixes: #1575 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 3eaf5597b2..83834899c8 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1471,7 +1471,14 @@ static void rib_process(struct route_node *rn)
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
zlog_debug("%u:%s: Processing rn %p", vrf_id, buf, rn);
- old_fib = dest->selected_fib;
+ /*
+ * 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)
+ old_fib = dest->selected_fib;
RNODE_FOREACH_RE_SAFE (rn, re, next) {
if (IS_ZEBRA_DEBUG_RIB_DETAILED)