summaryrefslogtreecommitdiff
path: root/pimd/pim_pim.c
diff options
context:
space:
mode:
authorMobashshera Rasool <mrasool@vmware.com>2021-10-01 00:36:10 -0700
committerMobashshera Rasool <mrasool@vmware.com>2021-10-03 22:04:34 -0700
commit79992e8a4257c35a1d255c24aa3b2df2f8b80b96 (patch)
tree17dd52a0799dac9ece8c49c465b9428ee3169c01 /pimd/pim_pim.c
parent31df775552690649ab769c57ed796a9de82fa22b (diff)
pimd: Add a flag to decide PIM has to send Hello
Problem Statement: ================== pim maintains two counters hello tx and hello rx at interface level. At present pim needs to send the hello message prior to other pim message as per RFC. This logic is getting derived from the tx hello counters. So when a new neighbor is added, tx counters are set to zero and then based on this, it is further decided to send hello in pim_hello_require function. Fix: ==== Separating the hello statistics and the logic to decide when to send hello based on a new flag. pim_ifstat_hello_sent will be used to note down the hello stats while a new flag is added to decide whether to send hello or not if it is the first packet to a neighbor. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
Diffstat (limited to 'pimd/pim_pim.c')
-rw-r--r--pimd/pim_pim.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c
index 8c38cf6c4c..5c3c4c23f4 100644
--- a/pimd/pim_pim.c
+++ b/pimd/pim_pim.c
@@ -455,6 +455,21 @@ void pim_ifstat_reset(struct interface *ifp)
pim_ifp->pim_ifstat_hello_sendfail = 0;
pim_ifp->pim_ifstat_hello_recv = 0;
pim_ifp->pim_ifstat_hello_recvfail = 0;
+ pim_ifp->pim_ifstat_bsm_rx = 0;
+ pim_ifp->pim_ifstat_bsm_tx = 0;
+ pim_ifp->pim_ifstat_join_recv = 0;
+ pim_ifp->pim_ifstat_join_send = 0;
+ pim_ifp->pim_ifstat_prune_recv = 0;
+ pim_ifp->pim_ifstat_prune_send = 0;
+ pim_ifp->pim_ifstat_reg_recv = 0;
+ pim_ifp->pim_ifstat_reg_send = 0;
+ pim_ifp->pim_ifstat_reg_stop_recv = 0;
+ pim_ifp->pim_ifstat_reg_stop_send = 0;
+ pim_ifp->pim_ifstat_assert_recv = 0;
+ pim_ifp->pim_ifstat_assert_send = 0;
+ pim_ifp->pim_ifstat_bsm_cfg_miss = 0;
+ pim_ifp->pim_ifstat_ucast_bsm_cfg_miss = 0;
+ pim_ifp->pim_ifstat_bsm_invalid_sz = 0;
}
void pim_sock_reset(struct interface *ifp)
@@ -707,6 +722,7 @@ int pim_hello_send(struct interface *ifp, uint16_t holdtime)
}
++pim_ifp->pim_ifstat_hello_sent;
+ PIM_IF_FLAG_SET_HELLO_SENT(pim_ifp->flags);
return 0;
}