summaryrefslogtreecommitdiff
path: root/pimd/pim_upstream.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2024-12-11 11:53:36 -0300
committerRafael Zalamena <rzalamena@opensourcerouting.org>2024-12-11 11:58:25 -0300
commitd4da6316c7ec016c8b89877fe081599bfb6f7f0c (patch)
treeecbea7c0e2a4df0b1aafbea2d8bdf846219706ef /pimd/pim_upstream.c
parent6d759deea14e683ebefa24c06edd157ca9799521 (diff)
pimd: move all MSDP code to its own place
Guard MSDP code to compile only on IPv4 and remove all MSDP code from PIMv6. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'pimd/pim_upstream.c')
-rw-r--r--pimd/pim_upstream.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index 7417f31137..8aa61b687d 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -178,7 +178,9 @@ struct pim_upstream *pim_upstream_del(struct pim_instance *pim,
{
struct listnode *node, *nnode;
struct pim_ifchannel *ch;
+#if PIM_IPV == 4
bool notify_msdp = false;
+#endif /* PIM_IPV == 4 */
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
@@ -206,12 +208,14 @@ struct pim_upstream *pim_upstream_del(struct pim_instance *pim,
if (up->join_state == PIM_UPSTREAM_JOINED) {
pim_jp_agg_single_upstream_send(&up->rpf, up, 0);
+#if PIM_IPV == 4
if (pim_addr_is_any(up->sg.src)) {
/* if a (*, G) entry in the joined state is being
* deleted we
* need to notify MSDP */
notify_msdp = true;
}
+#endif /* PIM_IPV == 4 */
}
join_timer_stop(up);
@@ -221,7 +225,9 @@ struct pim_upstream *pim_upstream_del(struct pim_instance *pim,
if (!pim_addr_is_any(up->sg.src)) {
if (pim->upstream_sg_wheel)
wheel_remove_item(pim->upstream_sg_wheel, up);
+#if PIM_IPV == 4
notify_msdp = true;
+#endif /* PIM_IPV == 4 */
}
pim_mroute_del(up->channel_oil, __func__);
@@ -241,9 +247,11 @@ struct pim_upstream *pim_upstream_del(struct pim_instance *pim,
rb_pim_upstream_del(&pim->upstream_head, up);
+#if PIM_IPV == 4
if (notify_msdp) {
pim_msdp_up_del(pim, &up->sg);
}
+#endif /* PIM_IPV == 4 */
/* When RP gets deleted, pim_rp_del() deregister addr with Zebra NHT
* and assign up->upstream_addr as INADDR_ANY.
@@ -723,7 +731,9 @@ void pim_upstream_switch(struct pim_instance *pim, struct pim_upstream *up,
if (old_state != PIM_UPSTREAM_JOINED) {
int old_fhr = PIM_UPSTREAM_FLAG_TEST_FHR(up->flags);
+#if PIM_IPV == 4
pim_msdp_up_join_state_changed(pim, up);
+#endif /* PIM_IPV == 4 */
if (pim_upstream_could_register(up)) {
PIM_UPSTREAM_FLAG_SET_FHR(up->flags);
if (!old_fhr
@@ -753,8 +763,10 @@ void pim_upstream_switch(struct pim_instance *pim, struct pim_upstream *up,
if (!pim_addr_is_any(up->sg.src))
up->sptbit = PIM_UPSTREAM_SPTBIT_FALSE;
+#if PIM_IPV == 4
if (old_state == PIM_UPSTREAM_JOINED)
pim_msdp_up_join_state_changed(pim, up);
+#endif /* PIM_IPV == 4 */
if (old_state != new_state) {
old_use_rpt =
@@ -1424,8 +1436,10 @@ struct pim_upstream *pim_upstream_keep_alive_timer_proc(
*/
}
+#if PIM_IPV == 4
/* source is no longer active - pull the SA from MSDP's cache */
pim_msdp_sa_local_del(pim, &up->sg);
+#endif /* PIM_IPV == 4 */
/* JoinDesired can change when KAT is started or stopped */
pim_upstream_update_join_desired(pim, up);
@@ -1493,32 +1507,15 @@ void pim_upstream_keep_alive_timer_start(struct pim_upstream *up, uint32_t time)
event_add_timer(router->master, pim_upstream_keep_alive_timer, up, time,
&up->t_ka_timer);
+#if PIM_IPV == 4
/* any time keepalive is started against a SG we will have to
* re-evaluate our active source database */
pim_msdp_sa_local_update(up);
+#endif /* PIM_IPV == 4 */
/* JoinDesired can change when KAT is started or stopped */
pim_upstream_update_join_desired(up->pim, up);
}
-/* MSDP on RP needs to know if a source is registerable to this RP */
-static void pim_upstream_msdp_reg_timer(struct event *t)
-{
- struct pim_upstream *up = EVENT_ARG(t);
- struct pim_instance *pim = up->channel_oil->pim;
-
- /* source is no longer active - pull the SA from MSDP's cache */
- pim_msdp_sa_local_del(pim, &up->sg);
-}
-
-void pim_upstream_msdp_reg_timer_start(struct pim_upstream *up)
-{
- EVENT_OFF(up->t_msdp_reg_timer);
- event_add_timer(router->master, pim_upstream_msdp_reg_timer, up,
- PIM_MSDP_REG_RXED_PERIOD, &up->t_msdp_reg_timer);
-
- pim_msdp_sa_local_update(up);
-}
-
/*
* 4.2.1 Last-Hop Switchover to the SPT
*