]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: There exists a path where on vrf bringup we do not create the pimreg
authorDonald Sharp <sharpd@nvidia.com>
Mon, 3 May 2021 18:39:47 +0000 (14:39 -0400)
committerIgor Ryzhov <iryzhov@nfware.com>
Thu, 27 May 2021 10:18:41 +0000 (13:18 +0300)
When creating configuration for a vrf *Before* the vrf has been
created, pim will not properly create the pimreg device and
we will promptly crash when we try to pass data.

Put some code checks in place to ensure that the pimreg is
created for vrf's.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
pimd/pim_iface.c
pimd/pim_instance.c

index 834399053b8d06780a983ea4b69a3944ac26b908..4a04c7a91e1ee1f2cd5421a1a651af2edf276174 100644 (file)
@@ -1566,6 +1566,16 @@ int pim_ifp_create(struct interface *ifp)
                if (pim_ifp)
                        pim_ifp->pim = pim;
                pim_if_addr_add_all(ifp);
+
+               /*
+                * Due to ordering issues based upon when
+                * a command is entered we should ensure that
+                * the pim reg is created for this vrf if we
+                * have configuration for it already.
+                *
+                * this is a no-op if it's already been done.
+                */
+               pim_if_create_pimreg(pim);
        }
 
        /*
index 019048abf15874a14eda090b642c1ee38f547e64..a7048ecefaaefef715d0b6dc9ce67ba6747ed895 100644 (file)
@@ -175,9 +175,18 @@ static int pim_vrf_delete(struct vrf *vrf)
 static int pim_vrf_enable(struct vrf *vrf)
 {
        struct pim_instance *pim = (struct pim_instance *)vrf->info;
+       struct interface *ifp;
 
        zlog_debug("%s: for %s", __func__, vrf->name);
 
+       FOR_ALL_INTERFACES (vrf, ifp) {
+               if (!ifp->info)
+                       continue;
+
+               pim_if_create_pimreg(pim);
+               break;
+       }
+
        pim_mroute_socket_enable(pim);
 
        return 0;