summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pimd/pim_oil.c10
-rw-r--r--pimd/pim_oil.h1
-rw-r--r--pimd/pim_rpf.c1
-rw-r--r--pimd/pim_upstream.c33
4 files changed, 14 insertions, 31 deletions
diff --git a/pimd/pim_oil.c b/pimd/pim_oil.c
index 35801aa49..55d26113f 100644
--- a/pimd/pim_oil.c
+++ b/pimd/pim_oil.c
@@ -190,10 +190,6 @@ struct channel_oil *pim_channel_oil_add(struct pim_instance *pim,
c_oil->installed = 0;
c_oil->up = pim_upstream_find(pim, sg);
c_oil->pim = pim;
- if (input_vif_index != MAXVIFS)
- c_oil->is_valid = 1;
- else
- c_oil->is_valid = 0;
listnode_add_sort(pim->channel_oil_list, c_oil);
@@ -453,10 +449,10 @@ int pim_channel_add_oif(struct channel_oil *channel_oil, struct interface *oif,
channel_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index] =
PIM_MROUTE_MIN_TTL;
- /* channel_oil->is_valid indicate if this entry is valid to get
- * installed in kernel.
+ /* channel_oil->oil.mfcc_parent != MAXVIFS indicate this entry is not
+ * valid to get installed in kernel.
*/
- if (channel_oil->is_valid) {
+ if (channel_oil->oil.mfcc_parent != MAXVIFS) {
if (pim_mroute_add(channel_oil, __PRETTY_FUNCTION__)) {
if (PIM_DEBUG_MROUTE) {
char group_str[INET_ADDRSTRLEN];
diff --git a/pimd/pim_oil.h b/pimd/pim_oil.h
index fef414cc8..5dd4e8b32 100644
--- a/pimd/pim_oil.h
+++ b/pimd/pim_oil.h
@@ -89,7 +89,6 @@ struct channel_oil {
struct pim_instance *pim;
struct mfcctl oil;
- bool is_valid;
int installed;
int oil_inherited_rescan;
int oil_size;
diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c
index 8adf253e5..ee145a5b5 100644
--- a/pimd/pim_rpf.c
+++ b/pimd/pim_rpf.c
@@ -325,7 +325,6 @@ void pim_upstream_rpf_clear(struct pim_instance *pim,
if (up->rpf.source_nexthop.interface) {
if (up->channel_oil) {
up->channel_oil->oil.mfcc_parent = MAXVIFS;
- up->channel_oil->is_valid = 0;
pim_mroute_del(up->channel_oil, __PRETTY_FUNCTION__);
}
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index 9cf25f0f9..cb89e30a5 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -306,19 +306,13 @@ static int on_join_timer(struct thread *t)
static void join_timer_stop(struct pim_upstream *up)
{
- struct pim_neighbor *nbr;
-
- if (!up->rpf.source_nexthop.interface) {
- if (PIM_DEBUG_TRACE)
- zlog_debug("%s: up %s RPF is not present",
- __PRETTY_FUNCTION__, up->sg_str);
- return;
- }
+ struct pim_neighbor *nbr = NULL;
THREAD_OFF(up->t_join_timer);
- nbr = pim_neighbor_find(up->rpf.source_nexthop.interface,
- up->rpf.rpf_addr.u.prefix4);
+ if (up->rpf.source_nexthop.interface)
+ nbr = pim_neighbor_find(up->rpf.source_nexthop.interface,
+ up->rpf.rpf_addr.u.prefix4);
if (nbr)
pim_jp_agg_remove_group(nbr->upstream_jp_agg, up);
@@ -330,13 +324,6 @@ void join_timer_start(struct pim_upstream *up)
{
struct pim_neighbor *nbr = NULL;
- if (!up->rpf.source_nexthop.interface) {
- if (PIM_DEBUG_TRACE)
- zlog_debug("%s: up %s RPF is not present",
- __PRETTY_FUNCTION__, up->sg_str);
- return;
- }
-
if (up->rpf.source_nexthop.interface) {
nbr = pim_neighbor_find(up->rpf.source_nexthop.interface,
up->rpf.rpf_addr.u.prefix4);
@@ -562,14 +549,16 @@ void pim_upstream_switch(struct pim_instance *pim, struct pim_upstream *up,
enum pim_upstream_state old_state = up->join_state;
if (up->upstream_addr.s_addr == INADDR_ANY) {
- zlog_debug("%s: RPF not configured for %s",
- __PRETTY_FUNCTION__, up->sg_str);
+ if (PIM_DEBUG_PIM_EVENTS)
+ zlog_debug("%s: RPF not configured for %s",
+ __PRETTY_FUNCTION__, up->sg_str);
return;
}
if (!up->rpf.source_nexthop.interface) {
- zlog_debug("%s: RP not reachable for %s",
- __PRETTY_FUNCTION__, up->sg_str);
+ if (PIM_DEBUG_PIM_EVENTS)
+ zlog_debug("%s: RP not reachable for %s",
+ __PRETTY_FUNCTION__, up->sg_str);
return;
}
@@ -949,7 +938,7 @@ void pim_upstream_update_join_desired(struct pim_instance *pim,
PIM_UPSTREAM_FLAG_UNSET_DR_JOIN_DESIRED(up->flags);
/* switched from false to true */
- if (is_join_desired) {
+ if (is_join_desired && (up->join_state == PIM_UPSTREAM_NOTJOINED)) {
pim_upstream_switch(pim, up, PIM_UPSTREAM_JOINED);
return;
}