[pim] Clean-up log messages
diff --git a/pimd/pim_hello.c b/pimd/pim_hello.c
index 8b710b8..545b3b1 100644
--- a/pimd/pim_hello.c
+++ b/pimd/pim_hello.c
@@ -197,7 +197,7 @@
if ((tlv_curr + option_len) > tlv_pastend) {
char src_str[100];
pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
- zlog_warn("%s: long PIM hello TLV type=%d length=%d > max=%d from %s on interface %s",
+ zlog_warn("%s: long PIM hello TLV type=%d length=%d > left=%d from %s on interface %s",
__PRETTY_FUNCTION__,
option_type, option_len, tlv_pastend - tlv_curr,
src_str, ifp->name);
diff --git a/pimd/pim_neighbor.c b/pimd/pim_neighbor.c
index b4112ed..9013b50 100644
--- a/pimd/pim_neighbor.c
+++ b/pimd/pim_neighbor.c
@@ -46,9 +46,11 @@
pim_ifp->pim_dr_addr = pim_ifp->primary_address;
- zlog_info("%s on interface %s",
- __PRETTY_FUNCTION__,
- ifp->name);
+ if (PIM_DEBUG_PIM_TRACE) {
+ zlog_debug("%s: on interface %s",
+ __PRETTY_FUNCTION__,
+ ifp->name);
+ }
for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_neighbor_list, node, neigh)) {
if (ntohl(neigh->source_addr.s_addr) > ntohl(pim_ifp->pim_dr_addr.s_addr)) {
@@ -70,15 +72,20 @@
pim_ifp->pim_dr_addr = pim_ifp->primary_address;
dr_pri = pim_ifp->pim_dr_priority;
- zlog_info("%s: dr pri %u on interface %s",
- __PRETTY_FUNCTION__,
- dr_pri, ifp->name);
-
+ if (PIM_DEBUG_PIM_TRACE) {
+ zlog_debug("%s: dr pri %u on interface %s",
+ __PRETTY_FUNCTION__,
+ dr_pri, ifp->name);
+ }
for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_neighbor_list, node, neigh)) {
- zlog_info("%s: neigh pri %u addr %x if dr addr %x",
- __PRETTY_FUNCTION__,
- neigh->dr_priority, ntohl(neigh->source_addr.s_addr) , ntohl(pim_ifp->pim_dr_addr.s_addr) );
+ if (PIM_DEBUG_PIM_TRACE) {
+ zlog_info("%s: neigh pri %u addr %x if dr addr %x",
+ __PRETTY_FUNCTION__,
+ neigh->dr_priority,
+ ntohl(neigh->source_addr.s_addr),
+ ntohl(pim_ifp->pim_dr_addr.s_addr));
+ }
if (
(neigh->dr_priority > dr_pri) ||
(
@@ -103,8 +110,6 @@
{
struct pim_interface *pim_ifp = ifp->info;
struct in_addr old_dr_addr;
- char dr_old_str[100];
- char dr_new_str[100];
pim_ifp->pim_dr_election_last = pim_time_monotonic_sec(); /* timestamp */
++pim_ifp->pim_dr_election_count;
@@ -118,22 +123,16 @@
dr_election_by_pri(ifp);
}
- pim_inet4_dump("<old_dr?>", old_dr_addr, dr_old_str, sizeof(dr_old_str));
- pim_inet4_dump("<new_dr?>", pim_ifp->pim_dr_addr, dr_new_str, sizeof(dr_new_str));
- zlog_info("%s: DR was %s now is %s on interface %s",
- __PRETTY_FUNCTION__,
- dr_old_str, dr_new_str, ifp->name);
-
/* DR changed ? */
if (old_dr_addr.s_addr != pim_ifp->pim_dr_addr.s_addr) {
- /* char dr_old_str[100]; */
- /* char dr_new_str[100]; */
- /* pim_inet4_dump("<old_dr?>", old_dr_addr, dr_old_str, sizeof(dr_old_str)); */
- /* pim_inet4_dump("<new_dr?>", pim_ifp->pim_dr_addr, dr_new_str, sizeof(dr_new_str)); */
- /* zlog_info("%s: DR was %s now is %s on interface %s", */
- /* __PRETTY_FUNCTION__, */
- /* dr_old_str, dr_new_str, ifp->name); */
-
+ char dr_old_str[100];
+ char dr_new_str[100];
+ pim_inet4_dump("<old_dr?>", old_dr_addr, dr_old_str, sizeof(dr_old_str));
+ pim_inet4_dump("<new_dr?>", pim_ifp->pim_dr_addr, dr_new_str, sizeof(dr_new_str));
+ zlog_info("%s: DR was %s now is %s on interface %s",
+ __PRETTY_FUNCTION__,
+ dr_old_str, dr_new_str, ifp->name);
+
pim_if_update_join_desired(pim_ifp);
pim_if_update_could_assert(ifp);
pim_if_update_assert_tracking_desired(ifp);