]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_iface.c
Merge pull request #5767 from ton31337/fix/replace_s_addr_0_to_INADDR_ANY
[mirror_frr.git] / pimd / pim_iface.c
index bc8dedc4f6f01bf5cf8722672ea5535133f6aac8..c615540149621e2ad70d314d81082bb2a70abcdc 100644 (file)
@@ -1476,11 +1476,18 @@ void pim_if_create_pimreg(struct pim_instance *pim)
                        snprintf(pimreg_name, sizeof(pimreg_name), "pimreg%u",
                                 pim->vrf->data.l.table_id);
 
-               pim->regiface = if_create(pimreg_name, pim->vrf_id);
+               pim->regiface = if_create_name(pimreg_name, pim->vrf_id);
                pim->regiface->ifindex = PIM_OIF_PIM_REGISTER_VIF;
 
                pim_if_new(pim->regiface, false, false, true,
                        false /*vxlan_term*/);
+               /*
+                * On vrf moves we delete the interface if there
+                * is nothing going on with it.  We cannot have
+                * the pimregiface deleted.
+                */
+               pim->regiface->configured = true;
+
        }
 }
 
@@ -1581,6 +1588,7 @@ int pim_ifp_create(struct interface *ifp)
 
 int pim_ifp_up(struct interface *ifp)
 {
+       struct pim_interface *pim_ifp;
        struct pim_instance *pim;
        uint32_t table_id;
 
@@ -1593,24 +1601,21 @@ int pim_ifp_up(struct interface *ifp)
        }
 
        pim = pim_get_pim_instance(ifp->vrf_id);
-       if (if_is_operative(ifp)) {
-               struct pim_interface *pim_ifp;
 
-               pim_ifp = ifp->info;
-               /*
-                * If we have a pim_ifp already and this is an if_add
-                * that means that we probably have a vrf move event
-                * If that is the case, set the proper vrfness.
-                */
-               if (pim_ifp)
-                       pim_ifp->pim = pim;
+       pim_ifp = ifp->info;
+       /*
+        * If we have a pim_ifp already and this is an if_add
+        * that means that we probably have a vrf move event
+        * If that is the case, set the proper vrfness.
+        */
+       if (pim_ifp)
+               pim_ifp->pim = pim;
 
-               /*
-                 pim_if_addr_add_all() suffices for bringing up both IGMP and
-                 PIM
-               */
-               pim_if_addr_add_all(ifp);
-       }
+       /*
+         pim_if_addr_add_all() suffices for bringing up both IGMP and
+         PIM
+       */
+       pim_if_addr_add_all(ifp);
 
        /*
         * If we have a pimreg device callback and it's for a specific