return new;
}
-static void bgp_pbr_rule_free(void *arg)
+static void bgp_pbr_rule_free(struct bgp_pbr_rule *pbr)
+{
+ XFREE(MTYPE_PBR_RULE, pbr);
+}
+
+static void bgp_pbr_rule_hash_free(void *arg)
{
struct bgp_pbr_rule *bpr;
bpr->action->refcnt--;
bpr->action = NULL;
}
- XFREE(MTYPE_PBR_RULE, bpr);
+ bgp_pbr_rule_free(bpr);
}
static void *bgp_pbr_rule_alloc_intern(void *arg)
void bgp_pbr_cleanup(struct bgp *bgp)
{
hash_clean_and_free(&bgp->pbr_match_hash, bgp_pbr_match_hash_free);
- hash_clean_and_free(&bgp->pbr_rule_hash, bgp_pbr_rule_free);
+ hash_clean_and_free(&bgp->pbr_rule_hash, bgp_pbr_rule_hash_free);
hash_clean_and_free(&bgp->pbr_action_hash, bgp_pbr_action_free);
if (bgp->bgp_pbr_cfg == NULL)
}
}
hash_release(bgp->pbr_rule_hash, bpr);
+ bgp_pbr_rule_free(bpr);
+
bgp_pbr_bpa_remove(bpa);
}