]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Create VRF if needed mergify/bp/stable/10.3/pr-18430 18433/head
authorNathan Bahr <nbahr@atcorp.com>
Wed, 19 Mar 2025 16:07:37 +0000 (16:07 +0000)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Wed, 19 Mar 2025 19:37:25 +0000 (19:37 +0000)
When creating a control plane protocol through NB, create the vrf
if needed instead of only looking up and asserting if it doesn't
exist yet.
Fixes 18429.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
(cherry picked from commit b6ae01f907c071be6cd197df0f3ca6fe9baa631a)

lib/routing_nb_config.c

index d532279a22aac3edda5332b2ff97dae743b1b4b8..3f0b661d0262d6714b88028dd0a540395ee39925 100644 (file)
@@ -47,7 +47,7 @@ int routing_control_plane_protocols_control_plane_protocol_create(
                 */
                if (nb_node_has_dependency(args->dnode->schema->priv)) {
                        vrfname = yang_dnode_get_string(args->dnode, "vrf");
-                       vrf = vrf_lookup_by_name(vrfname);
+                       vrf = vrf_get(VRF_UNKNOWN, vrfname);
                        assert(vrf);
                        nb_running_set_entry(args->dnode, vrf);
                }