]> git.puffer.fish Git - matthieu/frr.git/commitdiff
staticd,zebra: use ALLOW_RECURSION for static routes
authorMark Stapp <mjs@voltanet.io>
Fri, 8 May 2020 20:22:54 +0000 (16:22 -0400)
committerMark Stapp <mjs@voltanet.io>
Tue, 7 Jul 2020 17:14:01 +0000 (13:14 -0400)
Remove a special-case clause for static routes - it was the same
as the clause for other recursive routes. Have staticd just tell
zebra that recursion is allowed. Update topotest that was aware
of this 'internal' flag.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
staticd/static_zebra.c
tests/topotests/zebra_rib/r1/v4_route_1_static_override.json
zebra/zebra_nhg.c

index 5cadf3436561b680a295b60c989fd7f4a21909c0..c42f632ffb5eb7d61bfaaf67c2d88b4767e332c4 100644 (file)
@@ -363,6 +363,7 @@ extern void static_zebra_route_add(struct route_node *rn,
                memcpy(&api.src_prefix, src_pp, sizeof(api.src_prefix));
        }
        SET_FLAG(api.flags, ZEBRA_FLAG_RR_USE_DISTANCE);
+       SET_FLAG(api.flags, ZEBRA_FLAG_ALLOW_RECURSION);
        SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP);
        if (si_changed->distance) {
                SET_FLAG(api.message, ZAPI_MESSAGE_DISTANCE);
index aa9522aff6f680f963afadeca6d5586f306b9f54..22e199f9aa25db25cbc3b5cbdeba7d749a81703e 100644 (file)
@@ -10,7 +10,7 @@
       "installed":true,
       "table":254,
       "internalStatus":16,
-      "internalFlags":72,
+      "internalFlags":73,
       "internalNextHopNum":1,
       "internalNextHopActiveNum":1,
       "nexthops":[
index 02ba69bd4d1f7a97564740d135ef3026e8199f39..ce5e6a54d78e3ddf4d5a00a19be847901189adb1 100644 (file)
@@ -1953,33 +1953,6 @@ static int nexthop_active(afi_t afi, struct route_entry *re,
                                        __func__);
 
                        return resolved;
-               } else if (re->type == ZEBRA_ROUTE_STATIC) {
-                       resolved = 0;
-                       for (ALL_NEXTHOPS(match->nhe->nhg, newhop)) {
-                               if (!CHECK_FLAG(match->status,
-                                               ROUTE_ENTRY_INSTALLED))
-                                       continue;
-                               if (!nexthop_valid_resolve(nexthop, newhop))
-                                       continue;
-
-                               if (IS_ZEBRA_DEBUG_RIB_DETAILED)
-                                       zlog_debug("%s: STATIC match %p (%u), newhop %pNHv",
-                                                  __func__, match,
-                                                  match->nhe->id, newhop);
-
-                               SET_FLAG(nexthop->flags,
-                                        NEXTHOP_FLAG_RECURSIVE);
-                               nexthop_set_resolved(afi, newhop, nexthop);
-                               resolved = 1;
-                       }
-                       if (resolved)
-                               re->nexthop_mtu = match->mtu;
-
-                       if (!resolved && IS_ZEBRA_DEBUG_RIB_DETAILED)
-                               zlog_debug(
-                                       "        %s: Static route unable to resolve",
-                                       __func__);
-                       return resolved;
                } else {
                        if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
                                zlog_debug(