diff options
Diffstat (limited to 'zebra/zebra_pbr.c')
| -rw-r--r-- | zebra/zebra_pbr.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c index 43e21a6d34..405241fc22 100644 --- a/zebra/zebra_pbr.c +++ b/zebra/zebra_pbr.c @@ -36,6 +36,7 @@ /* definitions */ DEFINE_MTYPE_STATIC(ZEBRA, PBR_IPTABLE_IFNAME, "PBR interface list"); +DEFINE_MTYPE(ZEBRA, PBR_OBJ, "PBR"); /* definitions */ static const struct message ipset_type_msg[] = { @@ -163,7 +164,7 @@ void zebra_pbr_rules_free(void *arg) rule = (struct zebra_pbr_rule *)arg; (void)dplane_pbr_rule_delete(rule); - XFREE(MTYPE_TMP, rule); + XFREE(MTYPE_PBR_OBJ, rule); } uint32_t zebra_pbr_rules_hash_key(const void *arg) @@ -275,7 +276,7 @@ void zebra_pbr_ipset_free(void *arg) ipset = (struct zebra_pbr_ipset *)arg; hook_call(zebra_pbr_ipset_update, 0, ipset); - XFREE(MTYPE_TMP, ipset); + XFREE(MTYPE_PBR_OBJ, ipset); } uint32_t zebra_pbr_ipset_hash_key(const void *arg) @@ -319,7 +320,7 @@ void zebra_pbr_ipset_entry_free(void *arg) hook_call(zebra_pbr_ipset_entry_update, 0, ipset); - XFREE(MTYPE_TMP, ipset); + XFREE(MTYPE_PBR_OBJ, ipset); } uint32_t zebra_pbr_ipset_entry_hash_key(const void *arg) @@ -396,7 +397,7 @@ static void _zebra_pbr_iptable_free_all(void *arg, bool all) } list_delete(&iptable->interface_name_list); } - XFREE(MTYPE_TMP, iptable); + XFREE(MTYPE_PBR_OBJ, iptable); } void zebra_pbr_iptable_free(void *arg) @@ -478,7 +479,7 @@ static void *pbr_rule_alloc_intern(void *arg) zpr = (struct zebra_pbr_rule *)arg; - new = XCALLOC(MTYPE_TMP, sizeof(*new)); + new = XCALLOC(MTYPE_PBR_OBJ, sizeof(*new)); memcpy(new, zpr, sizeof(*zpr)); @@ -492,7 +493,7 @@ static struct zebra_pbr_rule *pbr_rule_free(struct zebra_pbr_rule *hash_data, zebra_neigh_deref(hash_data); hash_release(zrouter.rules_hash, hash_data); if (free_data) { - XFREE(MTYPE_TMP, hash_data); + XFREE(MTYPE_PBR_OBJ, hash_data); return NULL; } @@ -688,7 +689,7 @@ void zebra_pbr_add_rule(struct zebra_pbr_rule *rule) (void)dplane_pbr_rule_update(found, new); /* release the old hash data */ if (old) - XFREE(MTYPE_TMP, old); + XFREE(MTYPE_PBR_OBJ, old); } else { if (IS_ZEBRA_DEBUG_PBR) zlog_debug( @@ -856,7 +857,7 @@ static void *pbr_ipset_alloc_intern(void *arg) zpi = (struct zebra_pbr_ipset *)arg; - new = XCALLOC(MTYPE_TMP, sizeof(struct zebra_pbr_ipset)); + new = XCALLOC(MTYPE_PBR_OBJ, sizeof(struct zebra_pbr_ipset)); memcpy(new, zpi, sizeof(*zpi)); @@ -877,7 +878,7 @@ void zebra_pbr_destroy_ipset(struct zebra_pbr_ipset *ipset) (void)dplane_pbr_ipset_delete(ipset); if (lookup) { hash_release(zrouter.ipset_hash, lookup); - XFREE(MTYPE_TMP, lookup); + XFREE(MTYPE_PBR_OBJ, lookup); } else zlog_debug( "%s: IPSet Entry being deleted we know nothing about", @@ -930,7 +931,7 @@ static void *pbr_ipset_entry_alloc_intern(void *arg) zpi = (struct zebra_pbr_ipset_entry *)arg; - new = XCALLOC(MTYPE_TMP, sizeof(struct zebra_pbr_ipset_entry)); + new = XCALLOC(MTYPE_PBR_OBJ, sizeof(struct zebra_pbr_ipset_entry)); memcpy(new, zpi, sizeof(*zpi)); @@ -952,7 +953,7 @@ void zebra_pbr_del_ipset_entry(struct zebra_pbr_ipset_entry *ipset) (void)dplane_pbr_ipset_entry_delete(ipset); if (lookup) { hash_release(zrouter.ipset_entry_hash, lookup); - XFREE(MTYPE_TMP, lookup); + XFREE(MTYPE_PBR_OBJ, lookup); } else zlog_debug("%s: IPSet being deleted we know nothing about", __func__); @@ -967,7 +968,7 @@ static void *pbr_iptable_alloc_intern(void *arg) zpi = (struct zebra_pbr_iptable *)arg; - new = XCALLOC(MTYPE_TMP, sizeof(struct zebra_pbr_iptable)); + new = XCALLOC(MTYPE_PBR_OBJ, sizeof(struct zebra_pbr_iptable)); /* Deep structure copy */ memcpy(new, zpi, sizeof(*zpi)); @@ -1009,7 +1010,7 @@ void zebra_pbr_del_iptable(struct zebra_pbr_iptable *iptable) node); } list_delete(&iptable->interface_name_list); - XFREE(MTYPE_TMP, lookup); + XFREE(MTYPE_PBR_OBJ, lookup); } else zlog_debug("%s: IPTable being deleted we know nothing about", __func__); |
