From de67547dd2678a8ba64c0b3e66793c3d4452f1d4 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Thu, 26 Apr 2018 13:31:16 +0200 Subject: [PATCH] zebra: ipset and ipset entry deletion remove entry from hash list too This commit is a fix that removes the structure from the hash list, instead of just removing that structure. Signed-off-by: Philippe Guibert --- zebra/zebra_pbr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c index 54a9cdbc5b..050c93dbfc 100644 --- a/zebra/zebra_pbr.c +++ b/zebra/zebra_pbr.c @@ -369,9 +369,10 @@ void zebra_pbr_destroy_ipset(struct zebra_ns *zns, * - Netlink destroy from kernel * - ?? destroy ipset entries before */ - if (lookup) + if (lookup) { + hash_release(zns->ipset_hash, lookup); XFREE(MTYPE_TMP, lookup); - else + } else zlog_warn("%s: IPSet Entry being deleted we know nothing about", __PRETTY_FUNCTION__); } @@ -446,9 +447,10 @@ void zebra_pbr_del_ipset_entry(struct zebra_ns *zns, * - detach from ipset list * - ?? if no more entres, delete ipset */ - if (lookup) + if (lookup) { + hash_release(zns->ipset_entry_hash, lookup); XFREE(MTYPE_TMP, lookup); - else + } else zlog_warn("%s: IPSet being deleted we know nothing about", __PRETTY_FUNCTION__); } -- 2.39.5