]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd, pim6d: Rename and move api pim_cmd_interface_delete
authorMobashshera Rasool <mrasool@vmware.com>
Thu, 1 Jun 2023 08:56:41 +0000 (01:56 -0700)
committerMobashshera Rasool <mrasool@vmware.com>
Wed, 7 Jun 2023 06:59:55 +0000 (23:59 -0700)
Rename pim_cmd_interface_delete to pim_pim_interface_delete
and move the api to pimd/pim_iface.c

Changed the return type of the api from int to void.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
pimd/pim_iface.c
pimd/pim_iface.h
pimd/pim_nb_config.c

index 82548454a55fef6fee538a536988d22fdab67495..a83b8af0148901022ca46967201fa862915a2b39 100644 (file)
@@ -1775,3 +1775,27 @@ static void pim_if_membership_clear(struct interface *ifp)
 
        pim_ifchannel_membership_clear(ifp);
 }
+
+void pim_pim_interface_delete(struct interface *ifp)
+{
+       struct pim_interface *pim_ifp = ifp->info;
+
+       if (!pim_ifp)
+               return;
+
+       pim_ifp->pim_enable = false;
+
+       pim_if_membership_clear(ifp);
+
+       /*
+        * pim_sock_delete() removes all neighbors from
+        * pim_ifp->pim_neighbor_list.
+        */
+       pim_sock_delete(ifp, "pim unconfigured on interface");
+       pim_upstream_nh_if_update(pim_ifp->pim, ifp);
+
+       if (!pim_ifp->gm_enable) {
+               pim_if_addr_del_all(ifp);
+               pim_if_delete(ifp);
+       }
+}
index 973840a75385e326876e7532152410134b8fd098..ffde72de8119732b5d89c3ab75283076af4ed134 100644 (file)
@@ -243,5 +243,6 @@ bool pim_if_is_vrf_device(struct interface *ifp);
 int pim_if_ifchannel_count(struct pim_interface *pim_ifp);
 
 void pim_iface_init(void);
+void pim_pim_interface_delete(struct interface *ifp);
 
 #endif /* PIM_IFACE_H */
index d5d864f4a7124ee2030e4566cb3657f07bd09d3c..a43f461a14c9f30a16b665577258c8dbd56d2d92 100644 (file)
@@ -147,32 +147,6 @@ static int pim_cmd_interface_add(struct interface *ifp)
        return 1;
 }
 
-static int pim_cmd_interface_delete(struct interface *ifp)
-{
-       struct pim_interface *pim_ifp = ifp->info;
-
-       if (!pim_ifp)
-               return 1;
-
-       pim_ifp->pim_enable = false;
-
-       pim_if_membership_clear(ifp);
-
-       /*
-        * pim_sock_delete() removes all neighbors from
-        * pim_ifp->pim_neighbor_list.
-        */
-       pim_sock_delete(ifp, "pim unconfigured on interface");
-       pim_upstream_nh_if_update(pim_ifp->pim, ifp);
-
-       if (!pim_ifp->gm_enable) {
-               pim_if_addr_del_all(ifp);
-               pim_if_delete(ifp);
-       }
-
-       return 1;
-}
-
 static int interface_pim_use_src_cmd_worker(struct interface *ifp,
                pim_addr source_addr, char *errmsg, size_t errmsg_len)
 {
@@ -1559,12 +1533,7 @@ int lib_interface_pim_address_family_destroy(struct nb_cb_destroy_args *args)
                if (!pim_ifp)
                        return NB_OK;
 
-               if (!pim_cmd_interface_delete(ifp)) {
-                       snprintf(args->errmsg, args->errmsg_len,
-                                "Unable to delete interface information %s",
-                                ifp->name);
-                       return NB_ERR_INCONSISTENCY;
-               }
+               pim_pim_interface_delete(ifp);
        }
 
        return NB_OK;
@@ -1612,11 +1581,7 @@ int lib_interface_pim_address_family_pim_enable_modify(struct nb_cb_modify_args
                        if (!pim_ifp)
                                return NB_ERR_INCONSISTENCY;
 
-                       if (!pim_cmd_interface_delete(ifp)) {
-                               snprintf(args->errmsg, args->errmsg_len,
-                                        "Unable to delete interface information");
-                               return NB_ERR_INCONSISTENCY;
-                       }
+                       pim_pim_interface_delete(ifp);
                }
                break;
        }