summaryrefslogtreecommitdiff
path: root/pimd/pim_upstream.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-06-22 11:05:03 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-24 13:51:40 -0400
commit0885a9f1f4352996d95766b69fc29e464adee01c (patch)
tree93cca0199ebd05321ecc31928f5c43eed9a6f89a /pimd/pim_upstream.c
parent96ceedc7a27404a148bc9cc513b5b60e286cffc2 (diff)
pimd: Fix code to not send joins when SGRPT Prune is received
When we receive a SGRPT Prune we were switching the upstream to JOINED and immediately sending a join. This was not the right thing to do. This was happening because we were making decisions about the new ifchannel before it was fully formed. Rework ifchannel startup to provide enough information to the pim upstream data structure to make the right decisions Ticket: CM-16425 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_upstream.c')
-rw-r--r--pimd/pim_upstream.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index 7880bfd491..e7987eb6e7 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -602,7 +602,8 @@ int pim_upstream_compare(void *arg1, void *arg2)
static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
struct prefix_sg *sg,
struct interface *incoming,
- int flags)
+ int flags,
+ struct pim_ifchannel *ch)
{
enum pim_rpf_result rpf_result;
struct pim_interface *pim_ifp;
@@ -617,6 +618,9 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
up->sg = *sg;
pim_str_sg_set(sg, up->sg_str);
+ if (ch)
+ ch->upstream = up;
+
up = hash_get(pim->upstream_hash, up, hash_alloc_intern);
if (!pim_rp_set_upstream_addr(pim, &up->upstream_addr, sg->src,
sg->grp)) {
@@ -748,7 +752,8 @@ struct pim_upstream *pim_upstream_find_or_add(struct prefix_sg *sg,
up->ref_count);
}
} else
- up = pim_upstream_add(pim_ifp->pim, sg, incoming, flags, name);
+ up = pim_upstream_add(pim_ifp->pim, sg, incoming, flags, name,
+ NULL);
return up;
}
@@ -766,7 +771,8 @@ void pim_upstream_ref(struct pim_upstream *up, int flags, const char *name)
struct pim_upstream *pim_upstream_add(struct pim_instance *pim,
struct prefix_sg *sg,
struct interface *incoming, int flags,
- const char *name)
+ const char *name,
+ struct pim_ifchannel *ch)
{
struct pim_upstream *up = NULL;
int found = 0;
@@ -776,7 +782,7 @@ struct pim_upstream *pim_upstream_add(struct pim_instance *pim,
pim_upstream_ref(up, flags, name);
found = 1;
} else {
- up = pim_upstream_new(pim, sg, incoming, flags);
+ up = pim_upstream_new(pim, sg, incoming, flags, ch);
}
if (PIM_DEBUG_TRACE) {