]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: Ensure channel_oil_add is created through all paths
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 14 Jun 2019 00:03:08 +0000 (20:03 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 19 Jun 2019 23:13:10 +0000 (19:13 -0400)
If we create a channel_oil ensure that all paths that
we can go down will create one.  Future commits
can remove the (up->channel_oil) tests.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_mroute.c
pimd/pim_upstream.c

index d0cd27008ee4cfdec7f561c19bd6388852c8753e..b1c55c1f43438e9c54005dbf1c9a3e7c1d8d79fd 100644 (file)
@@ -201,6 +201,10 @@ static int pim_mroute_msg_nocache(int fd, struct interface *ifp,
                 * Let's blackhole those packets for the moment
                 * As that they will be coming up to the cpu
                 * and causing us to consider them.
+                *
+                * This *will* create a dangling channel_oil
+                * that I see no way to get rid of.  Just noting
+                * this for future reference.
                 */
                c_oil = pim_channel_oil_add(pim_ifp->pim, &sg,
                                            pim_ifp->mroute_vif_index,
index 2e6c5c7803501e333b7b6ab34bbf63eb8df53733..194fb2cffdd02af5dc053d73b09b14784726e177 100644 (file)
@@ -770,6 +770,18 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
                                up->channel_oil = pim_channel_oil_add(
                                        pim, &up->sg, pim_ifp->mroute_vif_index,
                                        __PRETTY_FUNCTION__);
+                       else {
+                               /*
+                                * Yeah this should not happen
+                                * but let's be sure that we are not
+                                * doing something stupid, all paths
+                                * through upstream creation will
+                                * create a channel oil
+                                */
+                               up->channel_oil = pim_channel_oil_add(
+                                       pim, &up->sg, MAXVIFS,
+                                       __PRETTY_FUNCTION__);
+                       }
                }
        }