mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 12:41:21 +00:00
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>
This commit is contained in:
parent
502dd27af9
commit
82144f532b
@ -3083,16 +3083,15 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
|
|||||||
/* Lookup route node. */
|
/* Lookup route node. */
|
||||||
rn = srcdest_rnode_lookup(table, p, src_p);
|
rn = srcdest_rnode_lookup(table, p, src_p);
|
||||||
if (!rn) {
|
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) {
|
if (IS_ZEBRA_DEBUG_RIB) {
|
||||||
|
char src_buf[PREFIX_STRLEN];
|
||||||
struct vrf *vrf = vrf_lookup_by_id(vrf_id);
|
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",
|
zlog_debug("%s[%d]:%pFX%s%s doesn't exist in rib",
|
||||||
vrf->name, table_id, p,
|
vrf->name, table_id, p,
|
||||||
(src_buf[0] != '\0') ? " from " : "",
|
(src_buf[0] != '\0') ? " from " : "",
|
||||||
|
Loading…
Reference in New Issue
Block a user