summaryrefslogtreecommitdiff
path: root/pimd/pim_instance.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-05-22 13:02:48 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-24 13:51:37 -0400
commit6d3c1953754fa1885bd0c9e93dd2d1c5c144abb8 (patch)
treea493f209fdadc7da44989535228d3142aafcc01b /pimd/pim_instance.c
parentb11e234147e7d5af674316898f749a3e3500914f (diff)
pimd: Fix startup of pim instance a bit
We will need to refine the difference between create and enable of a pim instance. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_instance.c')
-rw-r--r--pimd/pim_instance.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/pimd/pim_instance.c b/pimd/pim_instance.c
index eae05803cc..bfe2604e93 100644
--- a/pimd/pim_instance.c
+++ b/pimd/pim_instance.c
@@ -129,9 +129,22 @@ struct pim_instance *pim_get_pim_instance(vrf_id_t vrf_id)
static int pim_vrf_new(struct vrf *vrf)
{
- struct pim_instance *pim = vrf->info;
+ struct pim_instance *pim = pim_instance_init(vrf);
zlog_debug("VRF Created: %s(%d)", vrf->name, vrf->vrf_id);
+ if (pim == NULL) {
+ zlog_err("%s %s: pim class init failure ", __FILE__,
+ __PRETTY_FUNCTION__);
+ /*
+ * We will crash and burn otherwise
+ */
+ exit(1);
+ }
+
+ vrf->info = (void *)pim;
+
+ if (vrf->vrf_id == VRF_DEFAULT)
+ pimg = pim;
pim_ssmpingd_init(pim);
return 0;
@@ -149,23 +162,14 @@ static int pim_vrf_delete(struct vrf *vrf)
static int pim_vrf_enable(struct vrf *vrf)
{
- struct pim_instance *pim;
+ // struct pim_instance *pim;
zlog_debug("%s: for %s", __PRETTY_FUNCTION__, vrf->name);
- pim = pim_instance_init(vrf);
- if (pim == NULL) {
- zlog_err("%s %s: pim class init failure ", __FILE__,
- __PRETTY_FUNCTION__);
- /*
- * We will crash and burn otherwise
- */
- exit(1);
- }
- vrf->info = (void *)pim;
+ // vrf->info = (void *)pim;
- if (vrf->vrf_id == VRF_DEFAULT)
- pimg = pim;
+ // if (vrf->vrf_id == VRF_DEFAULT)
+ // pimg = pim;
return 0;
}