From b56114aa9e6cafd4ee4c27bc47e48a1d3b775cb3 Mon Sep 17 00:00:00 2001 From: Don Slice Date: Wed, 19 May 2021 14:23:28 -0400 Subject: [PATCH] ospfd: "ip ospf area" command can select wrong process Found that in some circumstances, when the "ip ospf area" command was entered for the default vrf, the wrong ospf process would be used to check for the presence of a "network" statement, causing the "ip ospf area" command to be rejected. This was due to the command using the ospf instance lookup to find the right ospf process, which can be in error depending on when the processes were created. Signed-off-by: Don Slice --- ospfd/ospf_vty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 04b6bdd961..fb2d790532 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -8926,7 +8926,7 @@ DEFUN (ip_ospf_area, argv_find(argv, argc, "area", &idx); areaid = argv[idx + 1]->arg; - if (ifp->vrf_id && !instance) + if (!instance) ospf = ospf_lookup_by_vrf_id(ifp->vrf_id); else ospf = ospf_lookup_instance(instance); @@ -9050,7 +9050,7 @@ DEFUN (no_ip_ospf_area, if (argv_find(argv, argc, "(1-65535)", &idx)) instance = strtol(argv[idx]->arg, NULL, 10); - if (ifp->vrf_id && !instance) + if (!instance) ospf = ospf_lookup_by_vrf_id(ifp->vrf_id); else ospf = ospf_lookup_instance(instance); -- 2.39.5