]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Remove uneeded freeing helper function
authorStephen Worley <sworley@cumulusnetworks.com>
Thu, 11 Apr 2019 16:47:03 +0000 (12:47 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 25 Oct 2019 15:13:39 +0000 (11:13 -0400)
Removing this function since the new paradigm
of everything just being nhg_connected structs
makes it not make a lot of sense.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
zebra/rt_netlink.c
zebra/zebra_nhg.c
zebra/zebra_nhg.h

index 4407167521c272e5cfd1095e8af762dc22bfb441..ae0cf8ab4575efc69675988e289656fbb8224434 100644 (file)
@@ -2399,7 +2399,8 @@ int netlink_nexthop_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
 
                if (!nhg->nexthop) {
                        /* Nothing to lookup */
-                       zebra_nhg_free_group_depends(&nhg, &nhg_depends);
+                       nexthop_group_free_delete(&nhg);
+                       nhg_connected_head_free(&nhg_depends);
                        return -1;
                }
 
@@ -2413,12 +2414,14 @@ int netlink_nexthop_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
                         */
 
                        zebra_nhg_set_invalid(nhe);
-                       zebra_nhg_free_group_depends(&nhg, &nhg_depends);
+                       nexthop_group_free_delete(&nhg);
+                       nhg_connected_head_free(&nhg_depends);
 
                } else {
                        /* This is a new nexthop group */
                        nhe = zebra_nhg_find(nhg, vrf_id, afi, id, &nhg_depends,
                                             true);
+                       /* The group was copied over, so free it */
                        nexthop_group_free_delete(&nhg);
 
                        if (!nhe) {
index cacbce1785ac026a631a69cbd15e38496738a73f..3198fc1dfa33ba3d1c1c977316ca4fdc9316fdbd 100644 (file)
@@ -529,32 +529,6 @@ struct nhg_hash_entry *zebra_nhg_find_nexthop(struct nexthop *nh, afi_t afi)
        return nhe;
 }
 
-/**
- * zebra_nhg_free_group_depends() - Helper function for freeing nexthop_group
- *                                 struct and depends
- *
- * @nhg:               Nexthop_group
- * @nhg_depends:       Nexthop group dependency tree head
- */
-void zebra_nhg_free_group_depends(struct nexthop_group **nhg,
-                                 struct nhg_connected_head *head)
-{
-       // TODO
-       //
-       //
-       // FIX THIS NAMING
-       //
-       //
-       //
-       //
-       //
-       if (head)
-               nhg_connected_head_free(head);
-
-       if (nhg)
-               nexthop_group_free_delete(nhg);
-}
-
 /**
  * zebra_nhg_free_members() - Free all members in the hash entry struct
  *
@@ -564,9 +538,8 @@ void zebra_nhg_free_group_depends(struct nexthop_group **nhg,
  */
 void zebra_nhg_free_members(struct nhg_hash_entry *nhe)
 {
-       zebra_nhg_free_group_depends(&nhe->nhg, &nhe->nhg_depends);
-
-       // TODO: Fixup this function
+       nexthop_group_free_delete(&nhe->nhg);
+       nhg_connected_head_free(&nhe->nhg_depends);
        nhg_connected_head_free(&nhe->nhg_dependents);
 }
 
index ebdc3a636f237bbf7ffc244be62968bec2c42872..1f8f63ad679fad17e0cf7483c4c378f04ff6ec7c 100644 (file)
@@ -156,8 +156,6 @@ extern struct nhg_hash_entry *zebra_nhg_find_nexthop(struct nexthop *nh,
                                                     afi_t afi);
 
 
-void zebra_nhg_free_group_depends(struct nexthop_group **nhg,
-                                 struct nhg_connected_head *head);
 void zebra_nhg_free_members(struct nhg_hash_entry *nhe);
 void zebra_nhg_free(void *arg);
 void zebra_nhg_release(struct nhg_hash_entry *nhe);