]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: fix config of vrf static routes
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 21 Mar 2018 20:47:46 +0000 (16:47 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 21 Mar 2018 20:47:46 +0000 (16:47 -0400)
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 <qlyoung@cumulusnetworks.com>
zebra/zebra_vty.c

index b65f4b8eb50087bb6719586f2de96aca6aea8484..32851761038d184060f9f1bc7d15ce42d3bd659e 100644 (file)
@@ -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;
 }