diff options
Diffstat (limited to 'pimd/pim_zebra.c')
| -rw-r--r-- | pimd/pim_zebra.c | 85 |
1 files changed, 30 insertions, 55 deletions
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index 05b6f23ed8..2efafd4b9b 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -340,14 +340,9 @@ static int pim_zebra_vxlan_sg_proc(ZAPI_CALLBACK_ARGS) stream_get(&sg.src.s_addr, s, prefixlen); stream_get(&sg.grp.s_addr, s, prefixlen); - if (PIM_DEBUG_ZEBRA) { - char sg_str[PIM_SG_LEN]; - - pim_str_sg_set(&sg, sg_str); - zlog_debug("%u:recv SG %s %s", vrf_id, - (cmd == ZEBRA_VXLAN_SG_ADD)?"add":"del", - sg_str); - } + if (PIM_DEBUG_ZEBRA) + zlog_debug("%u:recv SG %s %pSG", vrf_id, + (cmd == ZEBRA_VXLAN_SG_ADD) ? "add" : "del", &sg); if (cmd == ZEBRA_VXLAN_SG_ADD) pim_vxlan_sg_add(pim, &sg); @@ -520,9 +515,8 @@ static void igmp_source_forward_reevaluate_one(struct pim_instance *pim, if (ch && (ch->local_ifmembership == PIM_IFMEMBERSHIP_INCLUDE)) { if (PIM_DEBUG_PIM_EVENTS) - zlog_debug( - "local membership del for %s as G is now SSM", - pim_str_sg_dump(&sg)); + zlog_debug("local membership del for %pSG as G is now SSM", + &sg); pim_ifchannel_local_membership_del(group->interface, &sg); } @@ -531,9 +525,8 @@ static void igmp_source_forward_reevaluate_one(struct pim_instance *pim, if (!ch || (ch->local_ifmembership == PIM_IFMEMBERSHIP_NOINFO)) { if (PIM_DEBUG_PIM_EVENTS) - zlog_debug( - "local membership add for %s as G is now ASM", - pim_str_sg_dump(&sg)); + zlog_debug("local membership add for %pSG as G is now ASM", + &sg); pim_ifchannel_local_membership_add( group->interface, &sg, false /*is_vxlan*/); } @@ -569,7 +562,7 @@ void igmp_source_forward_reevaluate_all(struct pim_instance *pim) RB_FOREACH_SAFE (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb, ch_temp) { if (pim_is_grp_ssm(pim, ch->sg.grp)) { - if (ch->sg.src.s_addr == INADDR_ANY) + if (pim_addr_is_any(ch->sg.src)) pim_ifchannel_delete(ch); } } @@ -590,8 +583,7 @@ void igmp_source_forward_start(struct pim_instance *pim, sg.grp = source->source_group->group_addr; if (PIM_DEBUG_IGMP_TRACE) { - zlog_debug("%s: (S,G)=%s oif=%s fwd=%d", __func__, - pim_str_sg_dump(&sg), + zlog_debug("%s: (S,G)=%pSG oif=%s fwd=%d", __func__, &sg, source->source_group->interface->name, IGMP_SOURCE_TEST_FORWARDING(source->source_flags)); } @@ -655,10 +647,9 @@ void igmp_source_forward_start(struct pim_instance *pim, pim_inet4_dump("<source?>", vif_source, buf2, sizeof(buf2)); - zlog_debug( - "%s: NHT %s vif_source %s vif_index:%d ", - __func__, pim_str_sg_dump(&sg), buf2, - input_iface_vif_index); + zlog_debug("%s: NHT %pSG vif_source %s vif_index:%d ", + __func__, &sg, buf2, + input_iface_vif_index); } if (input_iface_vif_index < 1) { @@ -689,13 +680,12 @@ void igmp_source_forward_start(struct pim_instance *pim, /* ignore request for looped MFC entry */ if (PIM_DEBUG_IGMP_TRACE) { - zlog_debug( - "%s: ignoring request for looped MFC entry (S,G)=%s: oif=%s vif_index=%d", - __func__, - pim_str_sg_dump(&sg), - source->source_group - ->interface->name, - input_iface_vif_index); + zlog_debug("%s: ignoring request for looped MFC entry (S,G)=%pSG: oif=%s vif_index=%d", + __func__, + &sg, + source->source_group + ->interface->name, + input_iface_vif_index); } return; } @@ -704,10 +694,9 @@ void igmp_source_forward_start(struct pim_instance *pim, pim_channel_oil_add(pim, &sg, __func__); if (!source->source_channel_oil) { if (PIM_DEBUG_IGMP_TRACE) { - zlog_debug( - "%s %s: could not create OIL for channel (S,G)=%s", - __FILE__, __func__, - pim_str_sg_dump(&sg)); + zlog_debug("%s %s: could not create OIL for channel (S,G)=%pSG", + __FILE__, __func__, + &sg); } return; } @@ -728,10 +717,9 @@ void igmp_source_forward_start(struct pim_instance *pim, } } else { if (PIM_DEBUG_IGMP_TRACE) - zlog_debug( - "%s: %s was received on %s interface but we are not DR for that interface", - __func__, pim_str_sg_dump(&sg), - group->interface->name); + zlog_debug("%s: %pSG was received on %s interface but we are not DR for that interface", + __func__, &sg, + group->interface->name); return; } @@ -742,8 +730,8 @@ void igmp_source_forward_start(struct pim_instance *pim, if (!pim_ifchannel_local_membership_add(group->interface, &sg, false /*is_vxlan*/)) { if (PIM_DEBUG_MROUTE) - zlog_warn("%s: Failure to add local membership for %s", - __func__, pim_str_sg_dump(&sg)); + zlog_warn("%s: Failure to add local membership for %pSG", + __func__, &sg); pim_channel_del_oif(source->source_channel_oil, group->interface, PIM_OIF_FLAG_PROTO_IGMP, @@ -769,8 +757,7 @@ void igmp_source_forward_stop(struct gm_source *source) sg.grp = source->source_group->group_addr; if (PIM_DEBUG_IGMP_TRACE) { - zlog_debug("%s: (S,G)=%s oif=%s fwd=%d", __func__, - pim_str_sg_dump(&sg), + zlog_debug("%s: (S,G)=%pSG oif=%s fwd=%d", __func__, &sg, source->source_group->interface->name, IGMP_SOURCE_TEST_FORWARDING(source->source_flags)); } @@ -819,21 +806,9 @@ void pim_forward_start(struct pim_ifchannel *ch) struct pim_upstream *up = ch->upstream; uint32_t mask = 0; - if (PIM_DEBUG_PIM_TRACE) { - char source_str[INET_ADDRSTRLEN]; - char group_str[INET_ADDRSTRLEN]; - char upstream_str[INET_ADDRSTRLEN]; - - pim_inet4_dump("<source?>", ch->sg.src, source_str, - sizeof(source_str)); - pim_inet4_dump("<group?>", ch->sg.grp, group_str, - sizeof(group_str)); - pim_inet4_dump("<upstream?>", up->upstream_addr, upstream_str, - sizeof(upstream_str)); - zlog_debug("%s: (S,G)=(%s,%s) oif=%s (%pI4)", __func__, - source_str, group_str, ch->interface->name, - &up->upstream_addr); - } + if (PIM_DEBUG_PIM_TRACE) + zlog_debug("%s: (S,G)=%pSG oif=%s (%pI4)", __func__, &ch->sg, + ch->interface->name, &up->upstream_addr); if (PIM_IF_FLAG_TEST_PROTO_IGMP(ch->flags)) mask = PIM_OIF_FLAG_PROTO_IGMP; |
