From b88689f2a77007007246df5c4265ceca9bdf4fd2 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 21 Mar 2018 16:47:46 -0400 Subject: [PATCH] zebra: fix config of vrf static routes This patch fixes two bugs with respect to static route configuration inside vrf contexts: * Entering a negative form of a static route created the static route. * Once created, static routes could not be deleted. Signed-off-by: Quentin Young --- zebra/zebra_vty.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index b65f4b8eb5..3285176103 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -156,7 +156,7 @@ static int static_list_compare(void *arg1, void *arg2) if (ret) return ret; - ret = shr1->safi - shr2->afi; + ret = shr1->safi - shr2->safi; if (ret) return ret; @@ -259,7 +259,8 @@ static int zebra_static_route_holdem(struct zebra_vrf *zvrf, return CMD_SUCCESS; } - listnode_add_sort(static_list, shr); + if (!negate) + listnode_add_sort(static_list, shr); return CMD_SUCCESS; } -- 2.39.5