From: Donald Sharp Date: Mon, 22 May 2017 17:02:48 +0000 (-0400) Subject: pimd: Fix startup of pim instance a bit X-Git-Tag: frr-4.0-dev~468^2~89 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=6d3c1953754fa1885bd0c9e93dd2d1c5c144abb8;p=mirror%2Ffrr.git 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 --- 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; }