summaryrefslogtreecommitdiff
path: root/pimd/pim_rpf.c
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_rpf.c')
-rw-r--r--pimd/pim_rpf.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c
index 814d2e076b..ee145a5b51 100644
--- a/pimd/pim_rpf.c
+++ b/pimd/pim_rpf.c
@@ -205,6 +205,12 @@ enum pim_rpf_result pim_rpf_update(struct pim_instance *pim,
struct prefix src, grp;
bool neigh_needed = true;
+ if (up->upstream_addr.s_addr == INADDR_ANY) {
+ zlog_debug("%s: RP is not configured yet for %s",
+ __PRETTY_FUNCTION__, up->sg_str);
+ return PIM_RPF_OK;
+ }
+
saved.source_nexthop = rpf->source_nexthop;
saved.rpf_addr = rpf->rpf_addr;
@@ -308,6 +314,33 @@ enum pim_rpf_result pim_rpf_update(struct pim_instance *pim,
}
/*
+ * In the case of RP deletion and RP unreachablity,
+ * uninstall the mroute in the kernel and clear the
+ * rpf information in the pim upstream and pim channel
+ * oil data structure.
+ */
+void pim_upstream_rpf_clear(struct pim_instance *pim,
+ struct pim_upstream *up)
+{
+ if (up->rpf.source_nexthop.interface) {
+ if (up->channel_oil) {
+ up->channel_oil->oil.mfcc_parent = MAXVIFS;
+ pim_mroute_del(up->channel_oil, __PRETTY_FUNCTION__);
+
+ }
+ pim_upstream_switch(pim, up, PIM_UPSTREAM_NOTJOINED);
+ up->rpf.source_nexthop.interface = NULL;
+ up->rpf.source_nexthop.mrib_nexthop_addr.u.prefix4.s_addr =
+ PIM_NET_INADDR_ANY;
+ up->rpf.source_nexthop.mrib_metric_preference =
+ router->infinite_assert_metric.metric_preference;
+ up->rpf.source_nexthop.mrib_route_metric =
+ router->infinite_assert_metric.route_metric;
+ up->rpf.rpf_addr.u.prefix4.s_addr = PIM_NET_INADDR_ANY;
+ }
+}
+
+/*
RFC 4601: 4.1.6. State Summarization Macros
neighbor RPF'(S,G) {