summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2020-10-26 14:19:18 +0100
committerDonald Sharp <sharpd@nvidia.com>2020-10-29 14:00:43 +0100
commit82144f532bdb027bafc3ba26bb0191c4cffdf06b (patch)
tree51c291db8eb9ec05264bf8aece149b3bafcd905f /zebra
parentMerge pull request #7045 from mjstapp/fix_signals (diff)
downloadfrr-82144f532bdb027bafc3ba26bb0191c4cffdf06b.tar.xz
frr-82144f532bdb027bafc3ba26bb0191c4cffdf06b.zip
zebra: Don't do expensive string manip if not in debug
Modify the code to not load up a string that is only used in debugging unless we are debugging. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_rib.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 08daddb16..093e1c409 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -3083,16 +3083,15 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
/* Lookup route node. */
rn = srcdest_rnode_lookup(table, p, src_p);
if (!rn) {
- char src_buf[PREFIX_STRLEN];
-
- if (src_p && src_p->prefixlen)
- prefix2str(src_p, src_buf, sizeof(src_buf));
- else
- src_buf[0] = '\0';
-
if (IS_ZEBRA_DEBUG_RIB) {
+ char src_buf[PREFIX_STRLEN];
struct vrf *vrf = vrf_lookup_by_id(vrf_id);
+ if (src_p && src_p->prefixlen)
+ prefix2str(src_p, src_buf, sizeof(src_buf));
+ else
+ src_buf[0] = '\0';
+
zlog_debug("%s[%d]:%pFX%s%s doesn't exist in rib",
vrf->name, table_id, p,
(src_buf[0] != '\0') ? " from " : "",