diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-10-21 16:13:51 -0400 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-12-08 14:11:18 -0500 |
commit | 6d853c43d9dd315eb42211150b7a4a43bae4cb62 (patch) | |
tree | cc5f6ab4037c4221b735a3ab483a8548b2f0ab88 /pimd/pim_hello.c | |
parent | bf99b420a57b7c5bf44c8ab528d0a2e416b66d81 (diff) | |
download | quagga-6d853c43d9dd315eb42211150b7a4a43bae4cb62.tar.bz2 quagga-6d853c43d9dd315eb42211150b7a4a43bae4cb62.tar.xz |
pimd: Limit pim hello log messages
pimd was outputting allot of data surrounding pim hello packets.
In addition the debugging was inconsistent and not all turned
on via 'debug pim packet hello'.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_hello.c')
-rw-r--r-- | pimd/pim_hello.c | 115 |
1 files changed, 68 insertions, 47 deletions
diff --git a/pimd/pim_hello.c b/pimd/pim_hello.c index 12857831..bfc128b9 100644 --- a/pimd/pim_hello.c +++ b/pimd/pim_hello.c @@ -160,7 +160,8 @@ int pim_hello_recv(struct interface *ifp, uint32_t hello_option_generation_id = 0; struct list *hello_option_addr_list = 0; - on_trace(__PRETTY_FUNCTION__, ifp, src_addr); + if (PIM_DEBUG_PIM_HELLO) + on_trace(__PRETTY_FUNCTION__, ifp, src_addr); pim_ifp = ifp->info; zassert(pim_ifp); @@ -180,12 +181,14 @@ int pim_hello_recv(struct interface *ifp, int remain = tlv_pastend - tlv_curr; if (remain < PIM_TLV_MIN_SIZE) { - char src_str[100]; - pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); - zlog_warn("%s: short PIM hello TLV size=%d < min=%d from %s on interface %s", - __PRETTY_FUNCTION__, - remain, PIM_TLV_MIN_SIZE, - src_str, ifp->name); + if (PIM_DEBUG_PIM_HELLO) { + char src_str[100]; + pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); + zlog_debug("%s: short PIM hello TLV size=%d < min=%d from %s on interface %s", + __PRETTY_FUNCTION__, + remain, PIM_TLV_MIN_SIZE, + src_str, ifp->name); + } FREE_ADDR_LIST_THEN_RETURN(-1); } @@ -195,16 +198,18 @@ int pim_hello_recv(struct interface *ifp, tlv_curr += PIM_TLV_LENGTH_SIZE; 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 > left=%td from %s on interface %s", - __PRETTY_FUNCTION__, - option_type, option_len, tlv_pastend - tlv_curr, - src_str, ifp->name); + if (PIM_DEBUG_PIM_HELLO) { + char src_str[100]; + pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); + zlog_debug("%s: long PIM hello TLV type=%d length=%d > left=%td from %s on interface %s", + __PRETTY_FUNCTION__, + option_type, option_len, tlv_pastend - tlv_curr, + src_str, ifp->name); + } FREE_ADDR_LIST_THEN_RETURN(-2); } - if (PIM_DEBUG_PIM_TRACE || PIM_DEBUG_PIM_HELLO) { + if (PIM_DEBUG_PIM_HELLO) { char src_str[100]; pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); zlog_debug("%s: parse left_size=%d: PIM hello TLV type=%d length=%d from %s on %s", @@ -262,7 +267,7 @@ int pim_hello_recv(struct interface *ifp, } break; case PIM_MSG_OPTION_TYPE_DM_STATE_REFRESH: - if (PIM_DEBUG_PIM_TRACE || PIM_DEBUG_PIM_HELLO) { + if (PIM_DEBUG_PIM_HELLO) { char src_str[100]; pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); zlog_debug("%s: ignoring PIM hello dense-mode state refresh TLV option type=%d length=%d from %s on interface %s", @@ -272,13 +277,13 @@ int pim_hello_recv(struct interface *ifp, } break; default: - { + if (PIM_DEBUG_PIM_HELLO) { char src_str[100]; pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); - zlog_warn("%s: ignoring unknown PIM hello TLV type=%d length=%d from %s on interface %s", - __PRETTY_FUNCTION__, - option_type, option_len, - src_str, ifp->name); + zlog_debug("%s: ignoring unknown PIM hello TLV type=%d length=%d from %s on interface %s", + __PRETTY_FUNCTION__, + option_type, option_len, + src_str, ifp->name); } } @@ -289,7 +294,7 @@ int pim_hello_recv(struct interface *ifp, Check received PIM hello options */ - if (PIM_DEBUG_PIM_TRACE) { + if (PIM_DEBUG_PIM_HELLO) { tlv_trace_uint16(__PRETTY_FUNCTION__, "holdtime", ifp->name, src_addr, PIM_OPTION_IS_SET(hello_options, PIM_OPTION_MASK_HOLDTIME), @@ -321,11 +326,13 @@ int pim_hello_recv(struct interface *ifp, } if (!PIM_OPTION_IS_SET(hello_options, PIM_OPTION_MASK_HOLDTIME)) { - char src_str[100]; - pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); - zlog_warn("%s: PIM hello missing holdtime from %s on interface %s", - __PRETTY_FUNCTION__, - src_str, ifp->name); + if (PIM_DEBUG_PIM_HELLO) { + char src_str[100]; + pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); + zlog_debug("%s: PIM hello missing holdtime from %s on interface %s", + __PRETTY_FUNCTION__, + src_str, ifp->name); + } } /* @@ -345,11 +352,13 @@ int pim_hello_recv(struct interface *ifp, hello_option_generation_id, hello_option_addr_list); if (!neigh) { - char src_str[100]; - pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); - zlog_warn("%s: failure creating PIM neighbor %s on interface %s", - __PRETTY_FUNCTION__, - src_str, ifp->name); + if (PIM_DEBUG_PIM_HELLO) { + char src_str[100]; + pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); + zlog_warn("%s: failure creating PIM neighbor %s on interface %s", + __PRETTY_FUNCTION__, + src_str, ifp->name); + } FREE_ADDR_LIST_THEN_RETURN(-8); } @@ -372,7 +381,7 @@ int pim_hello_recv(struct interface *ifp, /* GenID mismatch, then replace neighbor */ - if (PIM_DEBUG_PIM_TRACE) { + if (PIM_DEBUG_PIM_HELLO) { char src_str[100]; pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); zlog_debug("%s: GenId mismatch new=%08x old=%08x: replacing neighbor %s on %s", @@ -394,11 +403,13 @@ int pim_hello_recv(struct interface *ifp, hello_option_generation_id, hello_option_addr_list); if (!neigh) { - char src_str[100]; - pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); - zlog_warn("%s: failure re-creating PIM neighbor %s on interface %s", - __PRETTY_FUNCTION__, - src_str, ifp->name); + if (PIM_DEBUG_PIM_HELLO) { + char src_str[100]; + pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); + zlog_debug("%s: failure re-creating PIM neighbor %s on interface %s", + __PRETTY_FUNCTION__, + src_str, ifp->name); + } FREE_ADDR_LIST_THEN_RETURN(-9); } /* actual addr list is saved under neighbor */ @@ -445,8 +456,10 @@ int pim_hello_build_tlv(const char *ifname, PIM_MSG_OPTION_TYPE_HOLDTIME, holdtime); if (!curr) { - zlog_warn("%s: could not set PIM hello Holdtime option for interface %s", - __PRETTY_FUNCTION__, ifname); + if (PIM_DEBUG_PIM_HELLO) { + zlog_debug("%s: could not set PIM hello Holdtime option for interface %s", + __PRETTY_FUNCTION__, ifname); + } return -1; } @@ -457,8 +470,10 @@ int pim_hello_build_tlv(const char *ifname, propagation_delay, override_interval); if (!tmp) { - zlog_warn("%s: could not set PIM LAN Prune Delay option for interface %s", - __PRETTY_FUNCTION__, ifname); + if (PIM_DEBUG_PIM_HELLO) { + zlog_debug("%s: could not set PIM LAN Prune Delay option for interface %s", + __PRETTY_FUNCTION__, ifname); + } return -1; } if (can_disable_join_suppression) { @@ -472,8 +487,10 @@ int pim_hello_build_tlv(const char *ifname, PIM_MSG_OPTION_TYPE_DR_PRIORITY, dr_priority); if (!curr) { - zlog_warn("%s: could not set PIM hello DR Priority option for interface %s", - __PRETTY_FUNCTION__, ifname); + if (PIM_DEBUG_PIM_HELLO) { + zlog_debug("%s: could not set PIM hello DR Priority option for interface %s", + __PRETTY_FUNCTION__, ifname); + } return -2; } @@ -483,8 +500,10 @@ int pim_hello_build_tlv(const char *ifname, PIM_MSG_OPTION_TYPE_GENERATION_ID, generation_id); if (!curr) { - zlog_warn("%s: could not set PIM hello Generation ID option for interface %s", - __PRETTY_FUNCTION__, ifname); + if (PIM_DEBUG_PIM_HELLO) { + zlog_debug("%s: could not set PIM hello Generation ID option for interface %s", + __PRETTY_FUNCTION__, ifname); + } return -3; } @@ -494,8 +513,10 @@ int pim_hello_build_tlv(const char *ifname, pastend, ifconnected); if (!curr) { - zlog_warn("%s: could not set PIM hello Secondary Address List option for interface %s", - __PRETTY_FUNCTION__, ifname); + if (PIM_DEBUG_PIM_HELLO) { + zlog_debug("%s: could not set PIM hello Secondary Address List option for interface %s", + __PRETTY_FUNCTION__, ifname); + } return -4; } } |