pimd: remove pim_str_sg_dump()

... and replace with `%pSG` printfrr specifier.  This actually used a
static buffer in the formatting function, so subsequent formatting would
overwrite earlier uses.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2022-01-04 21:24:48 +01:00
parent 9bace5c2d3
commit 98a81d2bff
13 changed files with 99 additions and 141 deletions

View File

@ -8246,13 +8246,12 @@ DEFPY_HIDDEN (pim_test_sg_keepalive,
up = pim_upstream_find(pim, &sg); up = pim_upstream_find(pim, &sg);
if (!up) { if (!up) {
vty_out(vty, "%% Unable to find %s specified\n", vty_out(vty, "%% Unable to find %pSG specified\n", &sg);
pim_str_sg_dump(&sg));
return CMD_WARNING; return CMD_WARNING;
} }
vty_out(vty, "Setting %s to current keep alive time: %d\n", vty_out(vty, "Setting %pSG to current keep alive time: %d\n", &sg,
pim_str_sg_dump(&sg), pim->keep_alive_time); pim->keep_alive_time);
pim_upstream_keep_alive_timer_start(up, pim->keep_alive_time); pim_upstream_keep_alive_timer_start(up, pim->keep_alive_time);
return CMD_SUCCESS; return CMD_SUCCESS;

View File

@ -455,8 +455,8 @@ struct pim_ifchannel *pim_ifchannel_find(struct interface *ifp, pim_sgaddr *sg)
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) { if (!pim_ifp) {
zlog_warn("%s: (S,G)=%s: multicast not enabled on interface %s", zlog_warn("%s: (S,G)=%pSG: multicast not enabled on interface %s",
__func__, pim_str_sg_dump(sg), ifp->name); __func__, sg, ifp->name);
return NULL; return NULL;
} }
@ -558,8 +558,7 @@ struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp, pim_sgaddr *sg,
if (ch->upstream) if (ch->upstream)
ch->upstream->flags |= up_flags; ch->upstream->flags |= up_flags;
else if (PIM_DEBUG_EVENTS) else if (PIM_DEBUG_EVENTS)
zlog_debug("%s:%s No Upstream found", __func__, zlog_debug("%s:%pSG No Upstream found", __func__, sg);
pim_str_sg_dump(sg));
return ch; return ch;
} }
@ -688,10 +687,9 @@ static int on_ifjoin_prune_pending_timer(struct thread *t)
ch = THREAD_ARG(t); ch = THREAD_ARG(t);
if (PIM_DEBUG_PIM_TRACE) if (PIM_DEBUG_PIM_TRACE)
zlog_debug( zlog_debug("%s: IFCHANNEL%pSG %s Prune Pending Timer Popped",
"%s: IFCHANNEL%s %s Prune Pending Timer Popped", __func__, &ch->sg,
__func__, pim_str_sg_dump(&ch->sg), pim_ifchannel_ifjoin_name(ch->ifjoin_state, ch->flags));
pim_ifchannel_ifjoin_name(ch->ifjoin_state, ch->flags));
if (ch->ifjoin_state == PIM_IFJOIN_PRUNE_PENDING) { if (ch->ifjoin_state == PIM_IFJOIN_PRUNE_PENDING) {
ifp = ch->interface; ifp = ch->interface;
@ -832,9 +830,9 @@ static int nonlocal_upstream(int is_join, struct interface *recv_ifp,
if (PIM_DEBUG_PIM_TRACE_DETAIL) { if (PIM_DEBUG_PIM_TRACE_DETAIL) {
char up_str[INET_ADDRSTRLEN]; char up_str[INET_ADDRSTRLEN];
pim_inet4_dump("<upstream?>", upstream, up_str, sizeof(up_str)); pim_inet4_dump("<upstream?>", upstream, up_str, sizeof(up_str));
zlog_warn("%s: recv %s (S,G)=%s to non-local upstream=%s on %s", zlog_warn("%s: recv %s (S,G)=%pSG to non-local upstream=%s on %s",
__func__, is_join ? "join" : "prune", __func__, is_join ? "join" : "prune",
pim_str_sg_dump(sg), up_str, recv_ifp->name); sg, up_str, recv_ifp->name);
} }
/* /*
@ -1049,10 +1047,9 @@ void pim_ifchannel_prune(struct interface *ifp, struct in_addr upstream,
ch = pim_ifchannel_find(ifp, sg); ch = pim_ifchannel_find(ifp, sg);
if (!ch && !(source_flags & PIM_ENCODE_RPT_BIT)) { if (!ch && !(source_flags & PIM_ENCODE_RPT_BIT)) {
if (PIM_DEBUG_PIM_TRACE) if (PIM_DEBUG_PIM_TRACE)
zlog_debug( zlog_debug("%s: Received prune with no relevant ifchannel %s%pSG state: %d",
"%s: Received prune with no relevant ifchannel %s%s state: %d", __func__, ifp->name, sg,
__func__, ifp->name, pim_str_sg_dump(sg), source_flags);
source_flags);
return; return;
} }
@ -1182,16 +1179,15 @@ int pim_ifchannel_local_membership_add(struct interface *ifp, pim_sgaddr *sg,
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) { if (!pim_ifp) {
if (PIM_DEBUG_EVENTS) if (PIM_DEBUG_EVENTS)
zlog_debug("%s:%s Expected pim interface setup for %s", zlog_debug("%s:%pSG Expected pim interface setup for %s",
__func__, pim_str_sg_dump(sg), ifp->name); __func__, sg, ifp->name);
return 0; return 0;
} }
if (!PIM_IF_TEST_PIM(pim_ifp->options)) { if (!PIM_IF_TEST_PIM(pim_ifp->options)) {
if (PIM_DEBUG_EVENTS) if (PIM_DEBUG_EVENTS)
zlog_debug( zlog_debug("%s:%pSG PIM is not configured on this interface %s",
"%s:%s PIM is not configured on this interface %s", __func__, sg, ifp->name);
__func__, pim_str_sg_dump(sg), ifp->name);
return 0; return 0;
} }
@ -1201,9 +1197,8 @@ int pim_ifchannel_local_membership_add(struct interface *ifp, pim_sgaddr *sg,
if (sg->src.s_addr == INADDR_ANY) { if (sg->src.s_addr == INADDR_ANY) {
if (pim_is_grp_ssm(pim, sg->grp)) { if (pim_is_grp_ssm(pim, sg->grp)) {
if (PIM_DEBUG_PIM_EVENTS) if (PIM_DEBUG_PIM_EVENTS)
zlog_debug( zlog_debug("%s: local membership (S,G)=%pSG ignored as group is SSM",
"%s: local membership (S,G)=%s ignored as group is SSM", __func__, sg);
__func__, pim_str_sg_dump(sg));
return 1; return 1;
} }
} }

View File

@ -65,12 +65,11 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,
pim_inet4_dump("<upstream?>", upstream, up_str, sizeof(up_str)); pim_inet4_dump("<upstream?>", upstream, up_str, sizeof(up_str));
pim_inet4_dump("<neigh?>", neigh->source_addr, neigh_str, pim_inet4_dump("<neigh?>", neigh->source_addr, neigh_str,
sizeof(neigh_str)); sizeof(neigh_str));
zlog_debug( zlog_debug("%s: join (S,G)=%pSG rpt=%d wc=%d upstream=%s holdtime=%d from %s on %s",
"%s: join (S,G)=%s rpt=%d wc=%d upstream=%s holdtime=%d from %s on %s", __func__, sg,
__func__, pim_str_sg_dump(sg), !!(source_flags & PIM_RPT_BIT_MASK),
!!(source_flags & PIM_RPT_BIT_MASK), !!(source_flags & PIM_WILDCARD_BIT_MASK), up_str,
!!(source_flags & PIM_WILDCARD_BIT_MASK), up_str, holdtime, neigh_str, ifp->name);
holdtime, neigh_str, ifp->name);
} }
pim_ifp = ifp->info; pim_ifp = ifp->info;
@ -135,12 +134,12 @@ static void recv_prune(struct interface *ifp, struct pim_neighbor *neigh,
pim_inet4_dump("<upstream?>", upstream, up_str, sizeof(up_str)); pim_inet4_dump("<upstream?>", upstream, up_str, sizeof(up_str));
pim_inet4_dump("<neigh?>", neigh->source_addr, neigh_str, pim_inet4_dump("<neigh?>", neigh->source_addr, neigh_str,
sizeof(neigh_str)); sizeof(neigh_str));
zlog_debug( zlog_debug("%s: prune (S,G)=%pSG rpt=%d wc=%d upstream=%s holdtime=%d from %s on %s",
"%s: prune (S,G)=%s rpt=%d wc=%d upstream=%s holdtime=%d from %s on %s", __func__, sg,
__func__, pim_str_sg_dump(sg), source_flags & PIM_RPT_BIT_MASK,
source_flags & PIM_RPT_BIT_MASK, source_flags & PIM_WILDCARD_BIT_MASK, up_str,
source_flags & PIM_WILDCARD_BIT_MASK, up_str, holdtime, holdtime,
neigh_str, ifp->name); neigh_str, ifp->name);
} }
pim_ifp = ifp->info; pim_ifp = ifp->info;

View File

@ -189,9 +189,8 @@ static int pim_mroute_msg_nocache(int fd, struct interface *ifp,
if (!(PIM_I_am_DR(pim_ifp))) { if (!(PIM_I_am_DR(pim_ifp))) {
if (PIM_DEBUG_MROUTE_DETAIL) if (PIM_DEBUG_MROUTE_DETAIL)
zlog_debug( zlog_debug("%s: Interface is not the DR blackholing incoming traffic for %pSG",
"%s: Interface is not the DR blackholing incoming traffic for %s", __func__, &sg);
__func__, pim_str_sg_dump(&sg));
/* /*
* We are not the DR, but we are still receiving packets * We are not the DR, but we are still receiving packets
@ -268,9 +267,8 @@ static int pim_mroute_msg_wholepkt(int fd, struct interface *ifp,
__func__, NULL); __func__, NULL);
if (!up) { if (!up) {
if (PIM_DEBUG_MROUTE) if (PIM_DEBUG_MROUTE)
zlog_debug( zlog_debug("%s: Unable to create upstream information for %pSG",
"%s: Unable to create upstream information for %s", __func__, &sg);
__func__, pim_str_sg_dump(&sg));
return 0; return 0;
} }
pim_upstream_keep_alive_timer_start( pim_upstream_keep_alive_timer_start(
@ -284,9 +282,8 @@ static int pim_mroute_msg_wholepkt(int fd, struct interface *ifp,
return 0; return 0;
} }
if (PIM_DEBUG_MROUTE_DETAIL) { if (PIM_DEBUG_MROUTE_DETAIL) {
zlog_debug( zlog_debug("%s: Unable to find upstream channel WHOLEPKT%pSG",
"%s: Unable to find upstream channel WHOLEPKT%s", __func__, &sg);
__func__, pim_str_sg_dump(&sg));
} }
return 0; return 0;
} }
@ -316,9 +313,8 @@ static int pim_mroute_msg_wholepkt(int fd, struct interface *ifp,
if (!up->t_rs_timer) { if (!up->t_rs_timer) {
if (pim_is_grp_ssm(pim_ifp->pim, sg.grp)) { if (pim_is_grp_ssm(pim_ifp->pim, sg.grp)) {
if (PIM_DEBUG_PIM_REG) if (PIM_DEBUG_PIM_REG)
zlog_debug( zlog_debug("%pSG register forward skipped as group is SSM",
"%s register forward skipped as group is SSM", &sg);
pim_str_sg_dump(&sg));
return 0; return 0;
} }
@ -361,18 +357,16 @@ static int pim_mroute_msg_wrongvif(int fd, struct interface *ifp,
if (!ifp) { if (!ifp) {
if (PIM_DEBUG_MROUTE) if (PIM_DEBUG_MROUTE)
zlog_debug( zlog_debug("%s: WRONGVIF (S,G)=%pSG could not find input interface for input_vif_index=%d",
"%s: WRONGVIF (S,G)=%s could not find input interface for input_vif_index=%d", __func__, &sg, msg->im_vif);
__func__, pim_str_sg_dump(&sg), msg->im_vif);
return -1; return -1;
} }
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) { if (!pim_ifp) {
if (PIM_DEBUG_MROUTE) if (PIM_DEBUG_MROUTE)
zlog_debug( zlog_debug("%s: WRONGVIF (S,G)=%pSG multicast not enabled on interface %s",
"%s: WRONGVIF (S,G)=%s multicast not enabled on interface %s", __func__, &sg, ifp->name);
__func__, pim_str_sg_dump(&sg), ifp->name);
return -2; return -2;
} }
@ -380,18 +374,16 @@ static int pim_mroute_msg_wrongvif(int fd, struct interface *ifp,
if (!ch) { if (!ch) {
pim_sgaddr star_g = sg; pim_sgaddr star_g = sg;
if (PIM_DEBUG_MROUTE) if (PIM_DEBUG_MROUTE)
zlog_debug( zlog_debug("%s: WRONGVIF (S,G)=%pSG could not find channel on interface %s",
"%s: WRONGVIF (S,G)=%s could not find channel on interface %s", __func__, &sg, ifp->name);
__func__, pim_str_sg_dump(&sg), ifp->name);
star_g.src.s_addr = INADDR_ANY; star_g.src.s_addr = INADDR_ANY;
ch = pim_ifchannel_find(ifp, &star_g); ch = pim_ifchannel_find(ifp, &star_g);
if (!ch) { if (!ch) {
if (PIM_DEBUG_MROUTE) if (PIM_DEBUG_MROUTE)
zlog_debug( zlog_debug("%s: WRONGVIF (*,G)=%pSG could not find channel on interface %s",
"%s: WRONGVIF (*,G)=%s could not find channel on interface %s", __func__, &star_g,
__func__, pim_str_sg_dump(&star_g), ifp->name);
ifp->name);
return -3; return -3;
} }
} }
@ -558,9 +550,8 @@ static int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp,
NULL); NULL);
if (!up) { if (!up) {
if (PIM_DEBUG_MROUTE) if (PIM_DEBUG_MROUTE)
zlog_debug( zlog_debug("%pSG: WRONGVIF%s unable to create upstream on interface",
"%s: WRONGVIF%s unable to create upstream on interface", &sg, ifp->name);
pim_str_sg_dump(&sg), ifp->name);
return -2; return -2;
} }
PIM_UPSTREAM_FLAG_SET_SRC_STREAM(up->flags); PIM_UPSTREAM_FLAG_SET_SRC_STREAM(up->flags);
@ -1218,9 +1209,8 @@ void pim_mroute_update_counters(struct channel_oil *c_oil)
sg.src = c_oil->oil.mfcc_origin; sg.src = c_oil->oil.mfcc_origin;
sg.grp = c_oil->oil.mfcc_mcastgrp; sg.grp = c_oil->oil.mfcc_mcastgrp;
zlog_debug( zlog_debug("Channel%pSG is not installed no need to collect data from kernel",
"Channel%s is not installed no need to collect data from kernel", &sg);
pim_str_sg_dump(&sg));
} }
return; return;
} }
@ -1236,8 +1226,8 @@ void pim_mroute_update_counters(struct channel_oil *c_oil)
sg.src = c_oil->oil.mfcc_origin; sg.src = c_oil->oil.mfcc_origin;
sg.grp = c_oil->oil.mfcc_mcastgrp; sg.grp = c_oil->oil.mfcc_mcastgrp;
zlog_warn("ioctl(SIOCGETSGCNT=%lu) failure for (S,G)=%s: errno=%d: %s", zlog_warn("ioctl(SIOCGETSGCNT=%lu) failure for (S,G)=%pSG: errno=%d: %s",
(unsigned long)SIOCGETSGCNT, pim_str_sg_dump(&sg), (unsigned long)SIOCGETSGCNT, &sg,
errno, safe_strerror(errno)); errno, safe_strerror(errno));
return; return;
} }

View File

@ -646,7 +646,7 @@ static void pim_msdp_up_xg_del(struct pim_instance *pim, pim_sgaddr *sg)
struct pim_msdp_sa *sa; struct pim_msdp_sa *sa;
if (PIM_DEBUG_MSDP_INTERNAL) { if (PIM_DEBUG_MSDP_INTERNAL) {
zlog_debug("MSDP %s del", pim_str_sg_dump(sg)); zlog_debug("MSDP %pSG del", sg);
} }
/* If this is not really an XG entry just move on */ /* If this is not really an XG entry just move on */
@ -667,7 +667,7 @@ static void pim_msdp_up_xg_del(struct pim_instance *pim, pim_sgaddr *sg)
void pim_msdp_up_del(struct pim_instance *pim, pim_sgaddr *sg) void pim_msdp_up_del(struct pim_instance *pim, pim_sgaddr *sg)
{ {
if (PIM_DEBUG_MSDP_INTERNAL) { if (PIM_DEBUG_MSDP_INTERNAL) {
zlog_debug("MSDP up %s del", pim_str_sg_dump(sg)); zlog_debug("MSDP up %pSG del", sg);
} }
if (sg->src.s_addr == INADDR_ANY) { if (sg->src.s_addr == INADDR_ANY) {
pim_msdp_up_xg_del(pim, sg); pim_msdp_up_xg_del(pim, sg);

View File

@ -77,7 +77,7 @@ static void pim_msdp_pkt_sa_dump_one(struct stream *s)
sg.grp.s_addr = stream_get_ipv4(s); sg.grp.s_addr = stream_get_ipv4(s);
sg.src.s_addr = stream_get_ipv4(s); sg.src.s_addr = stream_get_ipv4(s);
zlog_debug(" sg %s", pim_str_sg_dump(&sg)); zlog_debug(" sg %pSG", &sg);
} }
static void pim_msdp_pkt_sa_dump(struct stream *s) static void pim_msdp_pkt_sa_dump(struct stream *s)
@ -513,7 +513,7 @@ static void pim_msdp_pkt_sa_rx_one(struct pim_msdp_peer *mp, struct in_addr rp)
return; return;
} }
if (PIM_DEBUG_MSDP_PACKETS) { if (PIM_DEBUG_MSDP_PACKETS) {
zlog_debug(" sg %s", pim_str_sg_dump(&sg)); zlog_debug(" sg %pSG", &sg);
} }
pim_msdp_sa_ref(mp->pim, mp, &sg, rp); pim_msdp_sa_ref(mp->pim, mp, &sg, rp);

View File

@ -45,8 +45,8 @@ char *pim_channel_oil_dump(struct channel_oil *c_oil, char *buf, size_t size)
sg.src = c_oil->oil.mfcc_origin; sg.src = c_oil->oil.mfcc_origin;
sg.grp = c_oil->oil.mfcc_mcastgrp; sg.grp = c_oil->oil.mfcc_mcastgrp;
ifp = pim_if_find_by_vif_index(c_oil->pim, c_oil->oil.mfcc_parent); ifp = pim_if_find_by_vif_index(c_oil->pim, c_oil->oil.mfcc_parent);
snprintf(buf, size, "%s IIF: %s, OIFS: ", pim_str_sg_dump(&sg), snprintfrr(buf, size, "%pSG IIF: %s, OIFS: ", &sg,
ifp ? ifp->name : "(?)"); ifp ? ifp->name : "(?)");
out = buf + strlen(buf); out = buf + strlen(buf);
for (i = 0; i < MAXVIFS; i++) { for (i = 0; i < MAXVIFS; i++) {
@ -163,8 +163,7 @@ struct channel_oil *pim_channel_oil_add(struct pim_instance *pim,
rb_pim_oil_add(&pim->channel_oil_head, c_oil); rb_pim_oil_add(&pim->channel_oil_head, c_oil);
if (PIM_DEBUG_MROUTE) if (PIM_DEBUG_MROUTE)
zlog_debug("%s(%s): c_oil %s add", zlog_debug("%s(%s): c_oil %pSG add", __func__, name, sg);
__func__, name, pim_str_sg_dump(sg));
return c_oil; return c_oil;
} }

View File

@ -75,9 +75,8 @@ void pim_register_stop_send(struct interface *ifp, pim_sgaddr *sg,
struct prefix p; struct prefix p;
if (PIM_DEBUG_PIM_REG) { if (PIM_DEBUG_PIM_REG) {
zlog_debug("Sending Register stop for %s to %pI4 on %s", zlog_debug("Sending Register stop for %pSG to %pI4 on %s", sg,
pim_str_sg_dump(sg), &originator, &originator, ifp->name);
ifp->name);
} }
memset(buffer, 0, 10000); memset(buffer, 0, 10000);
@ -377,8 +376,8 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr,
char src_str[INET_ADDRSTRLEN]; char src_str[INET_ADDRSTRLEN];
pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
zlog_debug("Received Register message%s from %s on %s, rp: %d", zlog_debug("Received Register message%pSG from %s on %s, rp: %d",
pim_str_sg_dump(&sg), src_str, ifp->name, i_am_rp); &sg, src_str, ifp->name, i_am_rp);
} }
if (pim_is_grp_ssm(pim_ifp->pim, sg.grp)) { if (pim_is_grp_ssm(pim_ifp->pim, sg.grp)) {
@ -515,13 +514,11 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr,
} else { } else {
if (PIM_DEBUG_PIM_REG) { if (PIM_DEBUG_PIM_REG) {
if (!i_am_rp) if (!i_am_rp)
zlog_debug( zlog_debug("Received Register packet for %pSG, Rejecting packet because I am not the RP configured for group",
"Received Register packet for %s, Rejecting packet because I am not the RP configured for group", &sg);
pim_str_sg_dump(&sg));
else else
zlog_debug( zlog_debug("Received Register packet for %pSG, Rejecting packet because the dst ip address is not the actual RP",
"Received Register packet for %s, Rejecting packet because the dst ip address is not the actual RP", &sg);
pim_str_sg_dump(&sg));
} }
pim_register_stop_send(ifp, &sg, dest_addr, src_addr); pim_register_stop_send(ifp, &sg, dest_addr, src_addr);
} }

View File

@ -41,13 +41,3 @@ void pim_addr_dump(const char *onfail, struct prefix *p, char *buf,
errno = save_errno; errno = save_errno;
} }
char *pim_str_sg_dump(const pim_sgaddr *sg)
{
static char sg_str[PIM_SG_LEN];
snprintfrr(sg_str, sizeof(sg_str), "%pSG", sg);
return sg_str;
}

View File

@ -58,6 +58,5 @@ void pim_addr_dump(const char *onfail, struct prefix *p, char *buf,
int buf_size); int buf_size);
void pim_inet4_dump(const char *onfail, struct in_addr addr, char *buf, void pim_inet4_dump(const char *onfail, struct in_addr addr, char *buf,
int buf_size); int buf_size);
char *pim_str_sg_dump(const pim_sgaddr *sg);
#endif #endif

View File

@ -1092,8 +1092,8 @@ struct pim_upstream *pim_upstream_add(struct pim_instance *pim, pim_sgaddr *sg,
up->rpf.source_nexthop.interface->name : "Unknown" , up->rpf.source_nexthop.interface->name : "Unknown" ,
found, up->ref_count); found, up->ref_count);
else else
zlog_debug("%s(%s): (%s) failure to create", __func__, zlog_debug("%s(%s): (%pSG) failure to create", __func__,
name, pim_str_sg_dump(sg)); name, sg);
} }
return up; return up;

View File

@ -515,9 +515,8 @@ static void igmp_source_forward_reevaluate_one(struct pim_instance *pim,
if (ch if (ch
&& (ch->local_ifmembership == PIM_IFMEMBERSHIP_INCLUDE)) { && (ch->local_ifmembership == PIM_IFMEMBERSHIP_INCLUDE)) {
if (PIM_DEBUG_PIM_EVENTS) if (PIM_DEBUG_PIM_EVENTS)
zlog_debug( zlog_debug("local membership del for %pSG as G is now SSM",
"local membership del for %s as G is now SSM", &sg);
pim_str_sg_dump(&sg));
pim_ifchannel_local_membership_del(group->interface, pim_ifchannel_local_membership_del(group->interface,
&sg); &sg);
} }
@ -526,9 +525,8 @@ static void igmp_source_forward_reevaluate_one(struct pim_instance *pim,
if (!ch if (!ch
|| (ch->local_ifmembership == PIM_IFMEMBERSHIP_NOINFO)) { || (ch->local_ifmembership == PIM_IFMEMBERSHIP_NOINFO)) {
if (PIM_DEBUG_PIM_EVENTS) if (PIM_DEBUG_PIM_EVENTS)
zlog_debug( zlog_debug("local membership add for %pSG as G is now ASM",
"local membership add for %s as G is now ASM", &sg);
pim_str_sg_dump(&sg));
pim_ifchannel_local_membership_add( pim_ifchannel_local_membership_add(
group->interface, &sg, false /*is_vxlan*/); group->interface, &sg, false /*is_vxlan*/);
} }
@ -585,8 +583,7 @@ void igmp_source_forward_start(struct pim_instance *pim,
sg.grp = source->source_group->group_addr; sg.grp = source->source_group->group_addr;
if (PIM_DEBUG_IGMP_TRACE) { if (PIM_DEBUG_IGMP_TRACE) {
zlog_debug("%s: (S,G)=%s oif=%s fwd=%d", __func__, zlog_debug("%s: (S,G)=%pSG oif=%s fwd=%d", __func__, &sg,
pim_str_sg_dump(&sg),
source->source_group->interface->name, source->source_group->interface->name,
IGMP_SOURCE_TEST_FORWARDING(source->source_flags)); IGMP_SOURCE_TEST_FORWARDING(source->source_flags));
} }
@ -650,10 +647,9 @@ void igmp_source_forward_start(struct pim_instance *pim,
pim_inet4_dump("<source?>", vif_source, buf2, pim_inet4_dump("<source?>", vif_source, buf2,
sizeof(buf2)); sizeof(buf2));
zlog_debug( zlog_debug("%s: NHT %pSG vif_source %s vif_index:%d ",
"%s: NHT %s vif_source %s vif_index:%d ", __func__, &sg, buf2,
__func__, pim_str_sg_dump(&sg), buf2, input_iface_vif_index);
input_iface_vif_index);
} }
if (input_iface_vif_index < 1) { if (input_iface_vif_index < 1) {
@ -684,13 +680,12 @@ void igmp_source_forward_start(struct pim_instance *pim,
/* ignore request for looped MFC entry /* ignore request for looped MFC entry
*/ */
if (PIM_DEBUG_IGMP_TRACE) { if (PIM_DEBUG_IGMP_TRACE) {
zlog_debug( zlog_debug("%s: ignoring request for looped MFC entry (S,G)=%pSG: oif=%s vif_index=%d",
"%s: ignoring request for looped MFC entry (S,G)=%s: oif=%s vif_index=%d", __func__,
__func__, &sg,
pim_str_sg_dump(&sg), source->source_group
source->source_group ->interface->name,
->interface->name, input_iface_vif_index);
input_iface_vif_index);
} }
return; return;
} }
@ -699,10 +694,9 @@ void igmp_source_forward_start(struct pim_instance *pim,
pim_channel_oil_add(pim, &sg, __func__); pim_channel_oil_add(pim, &sg, __func__);
if (!source->source_channel_oil) { if (!source->source_channel_oil) {
if (PIM_DEBUG_IGMP_TRACE) { if (PIM_DEBUG_IGMP_TRACE) {
zlog_debug( zlog_debug("%s %s: could not create OIL for channel (S,G)=%pSG",
"%s %s: could not create OIL for channel (S,G)=%s", __FILE__, __func__,
__FILE__, __func__, &sg);
pim_str_sg_dump(&sg));
} }
return; return;
} }
@ -723,10 +717,9 @@ void igmp_source_forward_start(struct pim_instance *pim,
} }
} else { } else {
if (PIM_DEBUG_IGMP_TRACE) if (PIM_DEBUG_IGMP_TRACE)
zlog_debug( zlog_debug("%s: %pSG was received on %s interface but we are not DR for that interface",
"%s: %s was received on %s interface but we are not DR for that interface", __func__, &sg,
__func__, pim_str_sg_dump(&sg), group->interface->name);
group->interface->name);
return; return;
} }
@ -737,8 +730,8 @@ void igmp_source_forward_start(struct pim_instance *pim,
if (!pim_ifchannel_local_membership_add(group->interface, &sg, if (!pim_ifchannel_local_membership_add(group->interface, &sg,
false /*is_vxlan*/)) { false /*is_vxlan*/)) {
if (PIM_DEBUG_MROUTE) if (PIM_DEBUG_MROUTE)
zlog_warn("%s: Failure to add local membership for %s", zlog_warn("%s: Failure to add local membership for %pSG",
__func__, pim_str_sg_dump(&sg)); __func__, &sg);
pim_channel_del_oif(source->source_channel_oil, pim_channel_del_oif(source->source_channel_oil,
group->interface, PIM_OIF_FLAG_PROTO_IGMP, group->interface, PIM_OIF_FLAG_PROTO_IGMP,
@ -764,8 +757,7 @@ void igmp_source_forward_stop(struct gm_source *source)
sg.grp = source->source_group->group_addr; sg.grp = source->source_group->group_addr;
if (PIM_DEBUG_IGMP_TRACE) { if (PIM_DEBUG_IGMP_TRACE) {
zlog_debug("%s: (S,G)=%s oif=%s fwd=%d", __func__, zlog_debug("%s: (S,G)=%pSG oif=%s fwd=%d", __func__, &sg,
pim_str_sg_dump(&sg),
source->source_group->interface->name, source->source_group->interface->name,
IGMP_SOURCE_TEST_FORWARDING(source->source_flags)); IGMP_SOURCE_TEST_FORWARDING(source->source_flags));
} }

View File

@ -535,10 +535,9 @@ int pim_zlookup_sg_statistics(struct channel_oil *c_oil)
more.src = c_oil->oil.mfcc_origin; more.src = c_oil->oil.mfcc_origin;
more.grp = c_oil->oil.mfcc_mcastgrp; more.grp = c_oil->oil.mfcc_mcastgrp;
zlog_debug( zlog_debug("Sending Request for New Channel Oil Information%pSG VIIF %d(%s)",
"Sending Request for New Channel Oil Information%s VIIF %d(%s)", &more, c_oil->oil.mfcc_parent,
pim_str_sg_dump(&more), c_oil->oil.mfcc_parent, c_oil->pim->vrf->name);
c_oil->pim->vrf->name);
} }
if (!ifp) if (!ifp)
@ -593,9 +592,8 @@ int pim_zlookup_sg_statistics(struct channel_oil *c_oil)
more.grp = c_oil->oil.mfcc_mcastgrp; more.grp = c_oil->oil.mfcc_mcastgrp;
flog_err( flog_err(
EC_LIB_ZAPI_MISSMATCH, EC_LIB_ZAPI_MISSMATCH,
"%s: Received wrong %s(%s) information requested", "%s: Received wrong %pSG(%s) information requested",
__func__, pim_str_sg_dump(&more), __func__, &more, c_oil->pim->vrf->name);
c_oil->pim->vrf->name);
} }
zclient_lookup_failed(zlookup); zclient_lookup_failed(zlookup);
return -3; return -3;