pimd: Fix Join/Prune logging

For some reason Join/Prune debugs were being
turned on by trace not by the 'debug pim packets join'
command.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2016-07-23 19:18:19 -04:00 committed by Donald Sharp
parent c823065de9
commit 4950938e0c

View File

@ -37,7 +37,8 @@
#include "pim_rpf.h" #include "pim_rpf.h"
#include "pim_rp.h" #include "pim_rp.h"
static void on_trace(const char *label, static void
on_trace (const char *label,
struct interface *ifp, struct in_addr src) struct interface *ifp, struct in_addr src)
{ {
if (PIM_DEBUG_PIM_TRACE) { if (PIM_DEBUG_PIM_TRACE) {
@ -183,7 +184,7 @@ int pim_joinprune_recv(struct interface *ifp,
Check upstream address family Check upstream address family
*/ */
if (msg_upstream_addr.family != AF_INET) { if (msg_upstream_addr.family != AF_INET) {
if (PIM_DEBUG_PIM_TRACE) { if (PIM_DEBUG_PIM_J_P) {
char src_str[100]; char src_str[100];
pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
zlog_warn("%s: ignoring join/prune directed to unexpected addr family=%d from %s on %s", zlog_warn("%s: ignoring join/prune directed to unexpected addr family=%d from %s on %s",
@ -210,13 +211,13 @@ int pim_joinprune_recv(struct interface *ifp,
++buf; ++buf;
++buf; ++buf;
if (PIM_DEBUG_PIM_TRACE) { if (PIM_DEBUG_PIM_J_P) {
char src_str[100]; char src_str[100];
char upstream_str[100]; char upstream_str[100];
pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
pim_inet4_dump("<addr?>", msg_upstream_addr.u.prefix4, pim_inet4_dump("<addr?>", msg_upstream_addr.u.prefix4,
upstream_str, sizeof(upstream_str)); upstream_str, sizeof(upstream_str));
zlog_warn("%s: join/prune upstream=%s groups=%d holdtime=%d from %s on %s", zlog_debug ("%s: join/prune upstream=%s groups=%d holdtime=%d from %s on %s",
__PRETTY_FUNCTION__, __PRETTY_FUNCTION__,
upstream_str, msg_num_groups, msg_holdtime, upstream_str, msg_num_groups, msg_holdtime,
src_str, ifp->name); src_str, ifp->name);
@ -253,7 +254,7 @@ int pim_joinprune_recv(struct interface *ifp,
msg_num_pruned_sources = ntohs(*(const uint16_t *) buf); msg_num_pruned_sources = ntohs(*(const uint16_t *) buf);
buf += 2; buf += 2;
if (PIM_DEBUG_PIM_TRACE) { if (PIM_DEBUG_PIM_J_P) {
char src_str[100]; char src_str[100];
char upstream_str[100]; char upstream_str[100];
char group_str[100]; char group_str[100];
@ -322,6 +323,8 @@ int pim_joinprune_send(struct interface *ifp,
int pim_msg_size; int pim_msg_size;
int remain; int remain;
on_trace (__PRETTY_FUNCTION__, ifp, upstream_addr);
zassert(ifp); zassert(ifp);
pim_ifp = ifp->info; pim_ifp = ifp->info;
@ -333,7 +336,7 @@ int pim_joinprune_send(struct interface *ifp,
return -1; return -1;
} }
if (PIM_DEBUG_PIM_TRACE) { if (PIM_DEBUG_PIM_J_P) {
char dst_str[100]; char dst_str[100];
pim_inet4_dump("<dst?>", upstream_addr, dst_str, sizeof(dst_str)); pim_inet4_dump("<dst?>", upstream_addr, dst_str, sizeof(dst_str));
zlog_debug("%s: sending %s(S,G)=%s to upstream=%s on interface %s", zlog_debug("%s: sending %s(S,G)=%s to upstream=%s on interface %s",
@ -343,7 +346,7 @@ int pim_joinprune_send(struct interface *ifp,
} }
if (PIM_INADDR_IS_ANY(upstream_addr)) { if (PIM_INADDR_IS_ANY(upstream_addr)) {
if (PIM_DEBUG_PIM_TRACE) { if (PIM_DEBUG_PIM_J_P) {
char dst_str[100]; char dst_str[100];
pim_inet4_dump("<dst?>", upstream_addr, dst_str, sizeof(dst_str)); pim_inet4_dump("<dst?>", upstream_addr, dst_str, sizeof(dst_str));
zlog_debug("%s: %s(S,G)=%s: upstream=%s is myself on interface %s", zlog_debug("%s: %s(S,G)=%s: upstream=%s is myself on interface %s",