diff options
Diffstat (limited to 'lib/srcdest_table.c')
| -rw-r--r-- | lib/srcdest_table.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/srcdest_table.c b/lib/srcdest_table.c index 8ffa0e9709..a115507192 100644 --- a/lib/srcdest_table.c +++ b/lib/srcdest_table.c @@ -30,7 +30,7 @@ #include "table.h" #include "printfrr.h" -DEFINE_MTYPE_STATIC(LIB, ROUTE_SRC_NODE, "Route source node") +DEFINE_MTYPE_STATIC(LIB, ROUTE_SRC_NODE, "Route source node"); /* ----- functions to manage rnodes _with_ srcdest table ----- */ struct srcdest_rnode { @@ -313,8 +313,13 @@ static ssize_t printfrr_rn(char *buf, size_t bsz, const char *fmt, const struct route_node *rn = ptr; const struct prefix *dst_p, *src_p; - srcdest_rnode_prefixes(rn, &dst_p, &src_p); - srcdest2str(dst_p, (const struct prefix_ipv6 *)src_p, buf, bsz); + if (rn) { + srcdest_rnode_prefixes(rn, &dst_p, &src_p); + srcdest2str(dst_p, (const struct prefix_ipv6 *)src_p, buf, bsz); + } else { + strlcpy(buf, "NULL", bsz); + } + return 2; } |
