summaryrefslogtreecommitdiffstats
path: root/pimd/pim_iface.h
diff options
context:
space:
mode:
authorMobashshera Rasool <mrasool@vmware.com>2021-10-01 09:36:10 +0200
committerMobashshera Rasool <mrasool@vmware.com>2021-10-04 07:04:34 +0200
commit79992e8a4257c35a1d255c24aa3b2df2f8b80b96 (patch)
tree17dd52a0799dac9ece8c49c465b9428ee3169c01 /pimd/pim_iface.h
parentMerge pull request #9714 from idryzhov/bgp-ext-comm-doc (diff)
downloadfrr-79992e8a4257c35a1d255c24aa3b2df2f8b80b96.tar.xz
frr-79992e8a4257c35a1d255c24aa3b2df2f8b80b96.zip
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_iface.h')
-rw-r--r--pimd/pim_iface.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/pimd/pim_iface.h b/pimd/pim_iface.h
index 55c278d6e..514e158e7 100644
--- a/pimd/pim_iface.h
+++ b/pimd/pim_iface.h
@@ -61,6 +61,20 @@
#define PIM_I_am_DR(pim_ifp) (pim_ifp)->pim_dr_addr.s_addr == (pim_ifp)->primary_address.s_addr
#define PIM_I_am_DualActive(pim_ifp) (pim_ifp)->activeactive == true
+/* Macros for interface flags */
+
+/*
+ * PIM needs to know if hello is required to send before other PIM messages
+ * like Join, prune, assert would go out
+ */
+#define PIM_IF_FLAG_HELLO_SENT (1 << 0)
+
+#define PIM_IF_FLAG_TEST_HELLO_SENT(flags) ((flags)&PIM_IF_FLAG_HELLO_SENT)
+
+#define PIM_IF_FLAG_SET_HELLO_SENT(flags) ((flags) |= PIM_IF_FLAG_HELLO_SENT)
+
+#define PIM_IF_FLAG_UNSET_HELLO_SENT(flags) ((flags) &= ~PIM_IF_FLAG_HELLO_SENT)
+
struct pim_iface_upstream_switch {
struct in_addr address;
struct list *us;
@@ -161,6 +175,7 @@ struct pim_interface {
uint32_t pim_ifstat_bsm_cfg_miss;
uint32_t pim_ifstat_ucast_bsm_cfg_miss;
uint32_t pim_ifstat_bsm_invalid_sz;
+ uint8_t flags;
bool bsm_enable; /* bsm processing enable */
bool ucast_bsm_accept; /* ucast bsm processing */