From: Donald Sharp Date: Tue, 8 May 2018 14:58:30 +0000 (-0400) Subject: staticd: Fix recursive routes for certain types of nexthops X-Git-Tag: frr-6.1-dev~86^2~8 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=88a9001659d75a3909f0ecaaca63b5bc74583a7d;p=mirror%2Ffrr.git staticd: Fix recursive routes for certain types of nexthops 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 --- diff --git a/staticd/static_nht.c b/staticd/static_nht.c index e6592c9c9e..76f5da532b 100644 --- a/staticd/static_nht.c +++ b/staticd/static_nht.c @@ -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; diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c index 3f7440dfaf..0bb5d97868 100644 --- a/staticd/static_zebra.c +++ b/staticd/static_zebra.c @@ -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;