]> git.puffer.fish Git - mirror/frr.git/commitdiff
staticd: Fix recursive routes for certain types of nexthops
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 8 May 2018 14:58:30 +0000 (10:58 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sun, 29 Jul 2018 16:37:26 +0000 (12:37 -0400)
Existing NEXTHOP_TYPE_IPV4_IFINDEX and NEXTHOP_TYPE_IPV6_IFINDEX
routes allow recursion, but were broken when the route happened
to recursively resolve and the resolution nexthop changed.

This commit fixes this issue.  Please note that this issue was
in pre-move of static route handling to it's own daemon as well.
This was some easy low-hanging fruit, so to speak.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
staticd/static_nht.c
staticd/static_zebra.c

index e6592c9c9e38ff4c326b076d33de61b15d93c4e0..76f5da532b6bde5c7546b2aa5edc5f42ec75198c 100644 (file)
@@ -54,7 +54,9 @@ void static_nht_update(struct prefix *p, uint32_t nh_num,
                reinstall = false;
                for (si = rn->info; si; si = si->next) {
                        if (si->type != STATIC_IPV4_GATEWAY &&
-                           si->type != STATIC_IPV6_GATEWAY)
+                           si->type != STATIC_IPV4_GATEWAY_IFNAME &&
+                           si->type != STATIC_IPV6_GATEWAY &&
+                           si->type != STATIC_IPV6_GATEWAY_IFNAME)
                                continue;
 
                        orig = si->nh_valid;
index 3f7440dfaf29b29eaaa3a1d95662efb49f77821c..0bb5d97868643b413b191f4acc2bb426ba11d741 100644 (file)
@@ -216,17 +216,17 @@ void static_zebra_nht_register(struct static_route *si, bool reg)
 
        memset(&p, 0, sizeof(p));
        switch (si->type) {
-       case STATIC_IPV4_GATEWAY_IFNAME:
        case STATIC_IFNAME:
        case STATIC_BLACKHOLE:
-       case STATIC_IPV6_GATEWAY_IFNAME:
                return;
        case STATIC_IPV4_GATEWAY:
+       case STATIC_IPV4_GATEWAY_IFNAME:
                p.family = AF_INET;
                p.prefixlen = IPV4_MAX_BITLEN;
                p.u.prefix4 = si->addr.ipv4;
                break;
        case STATIC_IPV6_GATEWAY:
+       case STATIC_IPV6_GATEWAY_IFNAME:
                p.family = AF_INET6;
                p.prefixlen = IPV6_MAX_BITLEN;
                p.u.prefix6 = si->addr.ipv6;