summaryrefslogtreecommitdiff
path: root/pimd/pim_upstream.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-12-07 08:15:16 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-12-21 20:26:18 -0500
commit07335c8d082da51619883a9b4fff6f848e3dba1b (patch)
treecf4d167bf2be07777d4d3b7f4898f1c03a597391 /pimd/pim_upstream.c
parentee1a0718068320dae2f9711bd0aa41ab0b9c3c2a (diff)
pimd: Modify pim_upstream_new behavior
Modify pim_usptream_new to auto create the pim channel oil. Why? Because there exists situations where we have upstream state and we are attempting to set the inherited_olist on it and we have not created the channel oil yet. When that happens we end up with mroutes that are being meanies. 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 2b76cb9172..14508ad184 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -519,12 +519,14 @@ pim_upstream_compare (void *arg1, void *arg2)
return 0;
}
-static struct pim_upstream *pim_upstream_new(struct prefix_sg *sg,
- struct interface *incoming,
- int flags)
+static struct pim_upstream *
+pim_upstream_new (struct prefix_sg *sg,
+ struct interface *incoming,
+ int flags)
{
- struct pim_upstream *up;
enum pim_rpf_result rpf_result;
+ struct pim_interface *pim_ifp;
+ struct pim_upstream *up;
up = XCALLOC(MTYPE_PIM_UPSTREAM, sizeof(*up));
if (!up) {
@@ -602,6 +604,10 @@ static struct pim_upstream *pim_upstream_new(struct prefix_sg *sg,
return NULL;
}
+ pim_ifp = up->rpf.source_nexthop.interface->info;
+ if (pim_ifp)
+ up->channel_oil = pim_channel_oil_add(&up->sg, pim_ifp->mroute_vif_index);
+
listnode_add_sort(pim_upstream_list, up);
if (PIM_DEBUG_TRACE)