summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pimd/pim_neighbor.c17
-rw-r--r--pimd/pim_zebra.c2
-rw-r--r--pimd/pim_zebra.h1
3 files changed, 19 insertions, 1 deletions
diff --git a/pimd/pim_neighbor.c b/pimd/pim_neighbor.c
index 1b58b98502..a8a60f6f38 100644
--- a/pimd/pim_neighbor.c
+++ b/pimd/pim_neighbor.c
@@ -37,6 +37,7 @@
#include "pim_upstream.h"
#include "pim_ifchannel.h"
#include "pim_rp.h"
+#include "pim_zebra.h"
static void dr_election_by_addr(struct interface *ifp)
{
@@ -421,6 +422,18 @@ pim_neighbor_find_if (struct interface *ifp)
return listnode_head (pim_ifp->pim_neighbor_list);
}
+/* rpf info associated with an upstream entry needs to be re-evaluated
+ * when an RPF neighbor comes or goes */
+static void
+pim_neighbor_rpf_update(void)
+{
+ /* XXX: for the time being piggyback on the timer used on rib changes
+ * to scan and update the rpf nexthop. This is expensive processing
+ * and we should be able to optimize neighbor changes differently than
+ * nexthop changes. */
+ sched_rpf_cache_refresh();
+}
+
struct pim_neighbor *pim_neighbor_add(struct interface *ifp,
struct in_addr source_addr,
pim_hello_options hello_options,
@@ -483,6 +496,8 @@ struct pim_neighbor *pim_neighbor_add(struct interface *ifp,
pim_upstream_find_new_rpf();
pim_rp_setup ();
+
+ pim_neighbor_rpf_update();
return neigh;
}
@@ -595,6 +610,8 @@ void pim_neighbor_delete(struct interface *ifp,
listnode_delete(pim_ifp->pim_neighbor_list, neigh);
pim_neighbor_free(neigh);
+
+ pim_neighbor_rpf_update();
}
void pim_neighbor_delete_all(struct interface *ifp,
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index 294d8bba25..9239f875c4 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -545,7 +545,7 @@ static int on_rpf_cache_refresh(struct thread *t)
return 0;
}
-static void sched_rpf_cache_refresh()
+void sched_rpf_cache_refresh(void)
{
++qpim_rpf_cache_refresh_requests;
diff --git a/pimd/pim_zebra.h b/pimd/pim_zebra.h
index ae79ed815a..767cdf0541 100644
--- a/pimd/pim_zebra.h
+++ b/pimd/pim_zebra.h
@@ -39,4 +39,5 @@ void igmp_source_forward_stop(struct igmp_source *source);
void pim_forward_start(struct pim_ifchannel *ch);
void pim_forward_stop(struct pim_ifchannel *ch);
+void sched_rpf_cache_refresh(void);
#endif /* PIM_ZEBRA_H */