]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: cancel vrf creation if netns activation failed
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 19 Jul 2018 15:51:41 +0000 (17:51 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 26 Jul 2018 06:40:55 +0000 (08:40 +0200)
To keep configuration consistent, vrf that have not been able to be
associated with netns are removed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
zebra/zebra_netns_notify.c

index 7ca7b1e383111b073f51d2e851b5f15c78012399..b41d17df8c210bfb552bfcb7b746de65d0462fd0 100644 (file)
@@ -105,6 +105,7 @@ static void zebra_ns_notify_create_context_from_entry_name(const char *name)
        if (ret != CMD_SUCCESS) {
                zlog_warn("NS notify : failed to create NS %s", netnspath);
                ns_map_nsid_with_external(ns_id, false);
+               vrf_delete(vrf);
                return;
        }
        zlog_info("NS notify : created VRF %s NS %s", name, netnspath);