mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 21:10:28 +00:00
zebra: Only free if rule was found/release in table
We were seeing a double free on shutdown if the hash release fails here due to the interface state changing. We probably shouldn't free the data if its still being handled in the table so adding a check there and a debug message. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
parent
bfc2d87696
commit
c4097b758e
@ -471,8 +471,12 @@ static void zebra_pbr_cleanup_rules(struct hash_bucket *b, void *data)
|
||||
|
||||
if (rule->sock == *sock) {
|
||||
(void)kernel_del_pbr_rule(rule);
|
||||
hash_release(zrouter.rules_hash, rule);
|
||||
XFREE(MTYPE_TMP, rule);
|
||||
if (hash_release(zrouter.rules_hash, rule))
|
||||
XFREE(MTYPE_TMP, rule);
|
||||
else
|
||||
zlog_debug(
|
||||
"%s: Rule seq: %u is being cleaned but we can't find it in our tables",
|
||||
__func__, rule->rule.seq);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user