From: Donald Sharp Date: Thu, 3 Nov 2016 20:29:05 +0000 (-0400) Subject: pimd: Protect debug messages. X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~129 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=fad009d2887f22c413320b6cf209a2689afc7ea0;p=mirror%2Ffrr.git pimd: Protect debug messages. Protect some debug messages from being displayed always. Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_msg.c b/pimd/pim_msg.c index 1ae039e1c2..f58aec858e 100644 --- a/pimd/pim_msg.c +++ b/pimd/pim_msg.c @@ -220,32 +220,38 @@ pim_msg_join_prune_encode (uint8_t *buf, int buf_size, int is_join, { if (!pim_rpf_is_same(&up->rpf, &child->rpf)) { - zlog_debug ("%s: SPT Bit and RPF'(%s) != RPF'(S,G): Add Prune (%s,rpt) to compound message", - __PRETTY_FUNCTION__, star_g, pim_str_sg_dump (&child->sg)); + if (PIM_DEBUG_PIM_PACKETS) + zlog_debug ("%s: SPT Bit and RPF'(%s) != RPF'(S,G): Add Prune (%s,rpt) to compound message", + __PRETTY_FUNCTION__, star_g, pim_str_sg_dump (&child->sg)); } else - zlog_debug ("%s: SPT Bit and RPF'(%s) == RPF'(S,G): Not adding Prune for (%s,rpt)", - __PRETTY_FUNCTION__, star_g, pim_str_sg_dump (&child->sg)); + if (PIM_DEBUG_PIM_PACKETS) + zlog_debug ("%s: SPT Bit and RPF'(%s) == RPF'(S,G): Not adding Prune for (%s,rpt)", + __PRETTY_FUNCTION__, star_g, pim_str_sg_dump (&child->sg)); } else if (pim_upstream_is_sg_rpt (child)) { if (pim_upstream_empty_inherited_olist (child)) { - zlog_debug ("%s: inherited_olist(%s,rpt) is NULL, Add Prune to compound message", - __PRETTY_FUNCTION__, pim_str_sg_dump (&child->sg)); + if (PIM_DEBUG_PIM_PACKETS) + zlog_debug ("%s: inherited_olist(%s,rpt) is NULL, Add Prune to compound message", + __PRETTY_FUNCTION__, pim_str_sg_dump (&child->sg)); } else if (!pim_rpf_is_same (&up->rpf, &child->rpf)) { - zlog_debug ("%s: RPF'(%s) != RPF'(%s,rpt), Add Prune to compound message", - __PRETTY_FUNCTION__, star_g, pim_str_sg_dump (&child->sg)); + if (PIM_DEBUG_PIM_PACKETS) + zlog_debug ("%s: RPF'(%s) != RPF'(%s,rpt), Add Prune to compound message", + __PRETTY_FUNCTION__, star_g, pim_str_sg_dump (&child->sg)); } else - zlog_debug ("%s: RPF'(%s) == RPF'(%s,rpt), Do not add Prune to compound message", - __PRETTY_FUNCTION__, star_g, pim_str_sg_dump (&child->sg)); + if (PIM_DEBUG_PIM_PACKETS) + zlog_debug ("%s: RPF'(%s) == RPF'(%s,rpt), Do not add Prune to compound message", + __PRETTY_FUNCTION__, star_g, pim_str_sg_dump (&child->sg)); } else - zlog_debug ("%s: SPT bit is not set for (%s)", - __PRETTY_FUNCTION__, pim_str_sg_dump (&child->sg)); + if (PIM_DEBUG_PIM_PACKETS) + zlog_debug ("%s: SPT bit is not set for (%s)", + __PRETTY_FUNCTION__, pim_str_sg_dump (&child->sg)); } }