]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Set the nhe type in the appropriate place
authorStephen Worley <sworley@cumulusnetworks.com>
Fri, 4 Oct 2019 20:12:19 +0000 (16:12 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 25 Oct 2019 15:13:44 +0000 (11:13 -0400)
We were setting the nhe type on uninstall when it should be on
the install.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
zebra/zebra_nhg.c

index 44524ec507c557a6288a6b6d7613a45d5e795bcb..da6c2c26c60f0d3c9ad1e6578d3327369df89723 100644 (file)
@@ -1786,6 +1786,9 @@ void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe)
 
        if (!CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED)
            && !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_QUEUED)) {
+               /* Change its type to us since we are installing it */
+               nhe->type = ZEBRA_ROUTE_NHG;
+
                int ret = dplane_nexthop_add(nhe);
 
                switch (ret) {
@@ -1813,8 +1816,6 @@ void zebra_nhg_uninstall_kernel(struct nhg_hash_entry *nhe)
        if (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED)) {
                int ret = dplane_nexthop_delete(nhe);
 
-               /* Change its type to us since we are installing it */
-               nhe->type = ZEBRA_ROUTE_NHG;
                switch (ret) {
                case ZEBRA_DPLANE_REQUEST_QUEUED:
                        SET_FLAG(nhe->flags, NEXTHOP_GROUP_QUEUED);