summaryrefslogtreecommitdiff
path: root/pimd/pim_upstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_upstream.c')
-rw-r--r--pimd/pim_upstream.c55
1 files changed, 49 insertions, 6 deletions
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index d95849fce0..172d0d21c9 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -53,6 +53,7 @@
#include "pim_msdp.h"
#include "pim_jp_agg.h"
#include "pim_nht.h"
+#include "pim_ssm.h"
struct hash *pim_upstream_hash = NULL;
struct list *pim_upstream_list = NULL;
@@ -476,6 +477,51 @@ pim_upstream_could_register (struct pim_upstream *up)
return 0;
}
+/* Source registration is supressed for SSM groups. When the SSM range changes
+ * we re-revaluate register setup for existing upstream entries */
+void
+pim_upstream_register_reevaluate (void)
+{
+ struct listnode *upnode;
+ struct pim_upstream *up;
+
+ for (ALL_LIST_ELEMENTS_RO (pim_upstream_list, upnode, up))
+ {
+ /* If FHR is set CouldRegister is True. Also check if the flow
+ * is actually active; if it is not kat setup will trigger source
+ * registration whenever the flow becomes active. */
+ if (!PIM_UPSTREAM_FLAG_TEST_FHR (up->flags) || !up->t_ka_timer)
+ continue;
+
+ if (pim_is_grp_ssm (up->sg.grp))
+ {
+ /* clear the register state for SSM groups */
+ if (up->reg_state != PIM_REG_NOINFO)
+ {
+ if (PIM_DEBUG_PIM_EVENTS)
+ zlog_debug ("Clear register for %s as G is now SSM",
+ up->sg_str);
+ /* remove regiface from the OIL if it is there*/
+ pim_channel_del_oif (up->channel_oil, pim_regiface,
+ PIM_OIF_FLAG_PROTO_PIM);
+ up->reg_state = PIM_REG_NOINFO;
+ }
+ }
+ else
+ {
+ /* register ASM sources with the RP */
+ if (up->reg_state == PIM_REG_NOINFO)
+ {
+ if (PIM_DEBUG_PIM_EVENTS)
+ zlog_debug ("Register %s as G is now ASM", up->sg_str);
+ pim_channel_add_oif (up->channel_oil, pim_regiface,
+ PIM_OIF_FLAG_PROTO_PIM);
+ up->reg_state = PIM_REG_JOIN;
+ }
+ }
+ }
+}
+
void
pim_upstream_switch(struct pim_upstream *up,
enum pim_upstream_state new_state)
@@ -507,9 +553,8 @@ pim_upstream_switch(struct pim_upstream *up,
PIM_UPSTREAM_FLAG_SET_FHR(up->flags);
if (!old_fhr && PIM_UPSTREAM_FLAG_TEST_SRC_STREAM(up->flags))
{
- up->reg_state = PIM_REG_JOIN;
pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time);
- pim_channel_add_oif (up->channel_oil, pim_regiface, PIM_OIF_FLAG_PROTO_PIM);
+ pim_register_join (up);
}
}
else
@@ -1018,10 +1063,8 @@ static void pim_upstream_fhr_kat_start(struct pim_upstream *up)
zlog_debug ("kat started on %s; set fhr reg state to joined", up->sg_str);
PIM_UPSTREAM_FLAG_SET_FHR(up->flags);
- if (up->reg_state == PIM_REG_NOINFO) {
- pim_channel_add_oif (up->channel_oil, pim_regiface, PIM_OIF_FLAG_PROTO_PIM);
- up->reg_state = PIM_REG_JOIN;
- }
+ if (up->reg_state == PIM_REG_NOINFO)
+ pim_register_join (up);
}
}