From: Donald Sharp Date: Tue, 27 Feb 2018 02:26:33 +0000 (-0500) Subject: *: Rename ZEBRA_FLAG_INTERNAL -> ZEBRA_FLAG_ALLOW_RECURSION X-Git-Tag: frr-5.0-dev~199^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=4e8b02f4df5d6bcfde6390955b8feda2a17dc9bd;p=matthieu%2Ffrr.git *: Rename ZEBRA_FLAG_INTERNAL -> ZEBRA_FLAG_ALLOW_RECURSION The ZEBRA_FLAG_INTERNAL flag is used to signal to zebra that the route being added, the nexthops for it can be recursively resolved. This name keeps throwing me off when I read it so let's rename to something that allows the developer to understand what is going on. Signed-off-by: Donald Sharp --- diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 1da6136428..daa7ccbf42 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1026,14 +1026,14 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p, if (peer->sort == BGP_PEER_IBGP || peer->sort == BGP_PEER_CONFED || info->sub_type == BGP_ROUTE_AGGREGATE) { SET_FLAG(api.flags, ZEBRA_FLAG_IBGP); - SET_FLAG(api.flags, ZEBRA_FLAG_INTERNAL); + SET_FLAG(api.flags, ZEBRA_FLAG_ALLOW_RECURSION); } if ((peer->sort == BGP_PEER_EBGP && peer->ttl != 1) || CHECK_FLAG(peer->flags, PEER_FLAG_DISABLE_CONNECTED_CHECK) || bgp_flag_check(bgp, BGP_FLAG_DISABLE_NH_CONNECTED_CHK)) - SET_FLAG(api.flags, ZEBRA_FLAG_INTERNAL); + SET_FLAG(api.flags, ZEBRA_FLAG_ALLOW_RECURSION); /* Metric is currently based on the best-path only */ metric = info->attr->med; @@ -1265,14 +1265,14 @@ void bgp_zebra_withdraw(struct prefix *p, struct bgp_info *info, safi_t safi) SET_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE); if (peer->sort == BGP_PEER_IBGP) { - SET_FLAG(api.flags, ZEBRA_FLAG_INTERNAL); + SET_FLAG(api.flags, ZEBRA_FLAG_ALLOW_RECURSION); SET_FLAG(api.flags, ZEBRA_FLAG_IBGP); } if ((peer->sort == BGP_PEER_EBGP && peer->ttl != 1) || CHECK_FLAG(peer->flags, PEER_FLAG_DISABLE_CONNECTED_CHECK) || bgp_flag_check(peer->bgp, BGP_FLAG_DISABLE_NH_CONNECTED_CHK)) - SET_FLAG(api.flags, ZEBRA_FLAG_INTERNAL); + SET_FLAG(api.flags, ZEBRA_FLAG_ALLOW_RECURSION); if (bgp_debug_zebra(p)) { char buf[PREFIX_STRLEN]; diff --git a/lib/zebra.h b/lib/zebra.h index b9a795d160..11bf764b63 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -402,7 +402,7 @@ extern const char *zserv_command_string(unsigned int command); #define strmatch(a,b) (!strcmp((a), (b))) /* Zebra message flags */ -#define ZEBRA_FLAG_INTERNAL 0x01 +#define ZEBRA_FLAG_ALLOW_RECURSION 0x01 #define ZEBRA_FLAG_SELFROUTE 0x02 #define ZEBRA_FLAG_IBGP 0x08 #define ZEBRA_FLAG_SELECTED 0x10 diff --git a/nhrpd/nhrp_route.c b/nhrpd/nhrp_route.c index d43aa4929e..8178a8b4b5 100644 --- a/nhrpd/nhrp_route.c +++ b/nhrpd/nhrp_route.c @@ -114,7 +114,7 @@ void nhrp_route_announce(int add, enum nhrp_cache_type type, const struct prefix SET_FLAG(api.flags, ZEBRA_FLAG_FIB_OVERRIDE); break; } - SET_FLAG(api.flags, ZEBRA_FLAG_INTERNAL); + SET_FLAG(api.flags, ZEBRA_FLAG_ALLOW_RECURSION); SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP); api.nexthop_num = 1; diff --git a/pimd/TODO b/pimd/TODO index 57d2a17b5f..b9e4152830 100644 --- a/pimd/TODO +++ b/pimd/TODO @@ -167,9 +167,9 @@ T26 DONE Zebra daemon is marking recursive static route as inactive. pointing to kernel routes as inactive: zebra/zebra_rib.c nexthop_active_ipv4: -- Original: - else if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_INTERNAL)) + else if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_ALLOW_RECURSION)) -- Fixed: - else if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_INTERNAL) || + else if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_ALLOW_RECURSION) || match->type == ZEBRA_ROUTE_KERNEL) Old problem description: diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 5c316e077f..7f6c8aefa8 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -514,7 +514,7 @@ static int nexthop_active(afi_t afi, struct route_entry *re, nexthop->ifindex = newhop->ifindex; } return 1; - } else if (CHECK_FLAG(re->flags, ZEBRA_FLAG_INTERNAL)) { + } else if (CHECK_FLAG(re->flags, ZEBRA_FLAG_ALLOW_RECURSION)) { resolved = 0; for (ALL_NEXTHOPS(match->nexthop, newhop)) { if (!CHECK_FLAG(newhop->flags,