summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@users.noreply.github.com>2020-07-23 17:26:00 +0200
committerGitHub <noreply@github.com>2020-07-23 17:26:00 +0200
commitbd6cec43c37474f55afd855787e0f5212c9f9643 (patch)
tree8cba162ba6dde63eecf3948b60d87b75b29fd310
parentMerge pull request #6343 from opensourcerouting/watchfrr-n-20200505 (diff)
parentzebra: do not free iptable context, once created (diff)
downloadfrr-bd6cec43c37474f55afd855787e0f5212c9f9643.tar.xz
frr-bd6cec43c37474f55afd855787e0f5212c9f9643.zip
Merge pull request #6243 from pguibert6WIND/flowspec_some_regression_seen
Flowspec some regression seen
-rw-r--r--bgpd/bgp_flowspec_vty.c7
-rw-r--r--zebra/zebra_pbr.c17
2 files changed, 17 insertions, 7 deletions
diff --git a/bgpd/bgp_flowspec_vty.c b/bgpd/bgp_flowspec_vty.c
index 64a6c2ea8..e309fa948 100644
--- a/bgpd/bgp_flowspec_vty.c
+++ b/bgpd/bgp_flowspec_vty.c
@@ -376,11 +376,10 @@ void route_vty_out_flowspec(struct vty *vty, const struct prefix *p,
bpr->priority,
bpr->action->table_id);
}
- if (list_began)
- vty_out(vty, ")");
- vty_out(vty, "\n");
}
- if (!list_began)
+ if (list_began)
+ vty_out(vty, ")\n");
+ else
vty_out(vty, "\tnot installed in PBR\n");
}
}
diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c
index c5a779527..1bc8d893b 100644
--- a/zebra/zebra_pbr.c
+++ b/zebra/zebra_pbr.c
@@ -336,14 +336,20 @@ bool zebra_pbr_ipset_entry_hash_equal(const void *arg1, const void *arg2)
return true;
}
-void zebra_pbr_iptable_free(void *arg)
+/* this function gives option to flush plugin memory contexts
+ * with all parameter. set it to true to flush all
+ * set it to false to flush only passed arg argument
+ */
+static void _zebra_pbr_iptable_free_all(void *arg, bool all)
{
struct zebra_pbr_iptable *iptable;
struct listnode *node, *nnode;
char *name;
iptable = (struct zebra_pbr_iptable *)arg;
- hook_call(zebra_pbr_iptable_update, 0, iptable);
+
+ if (all)
+ hook_call(zebra_pbr_iptable_update, 0, iptable);
if (iptable->interface_name_list) {
for (ALL_LIST_ELEMENTS(iptable->interface_name_list, node,
@@ -356,6 +362,11 @@ void zebra_pbr_iptable_free(void *arg)
XFREE(MTYPE_TMP, iptable);
}
+void zebra_pbr_iptable_free(void *arg)
+{
+ _zebra_pbr_iptable_free_all(arg, false);
+}
+
uint32_t zebra_pbr_iptable_hash_key(const void *arg)
{
const struct zebra_pbr_iptable *iptable = arg;
@@ -529,7 +540,7 @@ static void zebra_pbr_cleanup_iptable(struct hash_bucket *b, void *data)
if (iptable->sock == *sock) {
if (hash_release(zrouter.iptable_hash, iptable))
- zebra_pbr_iptable_free(iptable);
+ _zebra_pbr_iptable_free_all(iptable, true);
else
hook_call(zebra_pbr_iptable_update, 0, iptable);
}