From 2287056228b52047ef459738f1d9faf690008e38 Mon Sep 17 00:00:00 2001 From: sarita patra Date: Mon, 4 Apr 2022 04:11:38 -0700 Subject: [PATCH] pimd: Handling Join/Prune statistics for passive interface Increment pim_ifstat_prune_send only when interface is passive disabled. Signed-off-by: sarita patra --- pimd/pim_join.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pimd/pim_join.c b/pimd/pim_join.c index 58de2c4a86..8c945b1e00 100644 --- a/pimd/pim_join.c +++ b/pimd/pim_join.c @@ -497,7 +497,7 @@ int pim_joinprune_send(struct pim_rpf *rpf, struct list *groups) pim_ifp->primary_address, qpim_all_pim_routers_addr, pim_msg, packet_size, - rpf->source_nexthop.interface->name)) { + rpf->source_nexthop.interface)) { zlog_warn( "%s: could not send PIM message on interface %s", __func__, @@ -535,8 +535,10 @@ int pim_joinprune_send(struct pim_rpf *rpf, struct list *groups) packet_size += group_size; pim_msg_build_jp_groups(grp, group, group_size); - pim_ifp->pim_ifstat_join_send += ntohs(grp->joins); - pim_ifp->pim_ifstat_prune_send += ntohs(grp->prunes); + if (!pim_ifp->pim_passive_enable) { + pim_ifp->pim_ifstat_join_send += ntohs(grp->joins); + pim_ifp->pim_ifstat_prune_send += ntohs(grp->prunes); + } if (PIM_DEBUG_PIM_TRACE) zlog_debug( @@ -555,7 +557,7 @@ int pim_joinprune_send(struct pim_rpf *rpf, struct list *groups) pim_ifp->primary_address, qpim_all_pim_routers_addr, pim_msg, packet_size, - rpf->source_nexthop.interface->name)) { + rpf->source_nexthop.interface)) { zlog_warn( "%s: could not send PIM message on interface %s", __func__, @@ -574,8 +576,7 @@ int pim_joinprune_send(struct pim_rpf *rpf, struct list *groups) pim_msg, packet_size, PIM_MSG_TYPE_JOIN_PRUNE, false); if (pim_msg_send(pim_ifp->pim_sock_fd, pim_ifp->primary_address, qpim_all_pim_routers_addr, pim_msg, - packet_size, - rpf->source_nexthop.interface->name)) { + packet_size, rpf->source_nexthop.interface)) { zlog_warn( "%s: could not send PIM message on interface %s", __func__, rpf->source_nexthop.interface->name); -- 2.39.5