]> git.proxmox.com Git - mirror_frr.git/commitdiff
ripd: unlink if-rmap container from global list before removing it
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 19 Apr 2019 19:54:29 +0000 (16:54 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 19 Apr 2019 19:54:29 +0000 (16:54 -0300)
This solves a crash that happens if the "route-map" command is used
after "router rip" + "no router rip" + "router rip".

Once interface route-maps are converted to the new northbound model,
we'll be able to remove the if_rmap_ctx_list global list (which is
an ugly hack to make things work right now).

Bug found by the CLI fuzzer.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
lib/if_rmap.c

index d8236b6b255e3829c446dea3ad6d27b9da18111d..b0802da96147950c5848ed87d552b1d0e6d4e719 100644 (file)
@@ -291,6 +291,7 @@ int config_write_if_rmap(struct vty *vty,
 
 void if_rmap_ctx_delete(struct if_rmap_ctx *ctx)
 {
+       listnode_delete(if_rmap_ctx_list, ctx);
        hash_clean(ctx->ifrmaphash, (void (*)(void *))if_rmap_free);
        if (ctx->name)
                XFREE(MTYPE_IF_RMAP_CTX_NAME, ctx);