]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Handling reg and reg_stop send statistics for passive interface
authorsarita patra <saritap@vmware.com>
Mon, 4 Apr 2022 11:13:07 +0000 (04:13 -0700)
committersarita patra <saritap@vmware.com>
Fri, 13 May 2022 06:51:21 +0000 (23:51 -0700)
Increment pim_ifstat_reg_stop_send & pim_ifstat_reg_send when
interface is passive disabled.

Signed-off-by: sarita patra <saritap@vmware.com>
pimd/pim_register.c

index fef5339749cf1023b5f0bff6de27345bea20e8a6..f18eb48eafba1fcd8d529a9fb1f1827a01cb9d80 100644 (file)
@@ -100,14 +100,16 @@ void pim_register_stop_send(struct interface *ifp, pim_sgaddr *sg, pim_addr src,
                return;
        }
        if (pim_msg_send(pinfo->pim_sock_fd, src, originator, buffer,
-                        b1length + PIM_MSG_REGISTER_STOP_LEN, ifp->name)) {
+                        b1length + PIM_MSG_REGISTER_STOP_LEN, ifp)) {
                if (PIM_DEBUG_PIM_TRACE) {
                        zlog_debug(
                                "%s: could not send PIM register stop message on interface %s",
                                __func__, ifp->name);
                }
        }
-       ++pinfo->pim_ifstat_reg_stop_send;
+
+       if (!pinfo->pim_passive_enable)
+               ++pinfo->pim_ifstat_reg_stop_send;
 }
 
 static void pim_reg_stop_upstream(struct pim_instance *pim,
@@ -266,10 +268,11 @@ void pim_register_send(const uint8_t *buf, int buf_size, pim_addr src,
        pim_msg_build_header(src, dst, buffer, buf_size + PIM_MSG_REGISTER_LEN,
                             PIM_MSG_TYPE_REGISTER, false);
 
-       ++pinfo->pim_ifstat_reg_send;
+       if (!pinfo->pim_passive_enable)
+               ++pinfo->pim_ifstat_reg_send;
 
        if (pim_msg_send(pinfo->pim_sock_fd, src, dst, buffer,
-                        buf_size + PIM_MSG_REGISTER_LEN, ifp->name)) {
+                        buf_size + PIM_MSG_REGISTER_LEN, ifp)) {
                if (PIM_DEBUG_PIM_TRACE) {
                        zlog_debug(
                                "%s: could not send PIM register message on interface %s",