X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=zebra%2Fzebra_rnh.c;h=b1fbe8a6536de6dbdf2bf91b6f520ec8664a7266;hb=91d227b7e3cb53ad8fdbcd9d4cff7f0a666918e3;hp=f57bf7984a54d4b2ddc182a4c024d24b105d924c;hpb=bc620fb370e8a7e3d525f84a2b138088be8e9301;p=mirror_frr.git diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index f57bf7984..b1fbe8a65 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -213,10 +213,14 @@ void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client, zebra_route_string(client->proto), rnh_str(rnh, buf, sizeof(buf)), type); } - if (!listnode_lookup(rnh->client_list, client)) { + if (!listnode_lookup(rnh->client_list, client)) listnode_add(rnh->client_list, client); - send_client(rnh, client, type, vrf_id); - } + + /* + * We always need to respond with known information, + * currently multiple daemons expect this behavior + */ + send_client(rnh, client, type, vrf_id); } void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client, @@ -524,8 +528,7 @@ static void zebra_rnh_process_pbr_tables(int family, */ static bool rnh_nexthop_valid(const struct nexthop *nh) { - return ((CHECK_FLAG(nh->flags, NEXTHOP_FLAG_FIB) - || CHECK_FLAG(nh->flags, NEXTHOP_FLAG_RECURSIVE)) + return (CHECK_FLAG(nh->flags, NEXTHOP_FLAG_FIB) && CHECK_FLAG(nh->flags, NEXTHOP_FLAG_ACTIVE)); } @@ -577,8 +580,7 @@ zebra_rnh_resolve_nexthop_entry(struct zebra_vrf *zvrf, int family, /* Just being SELECTED isn't quite enough - must * have an installed nexthop to be useful. */ - for (nexthop = re->ng.nexthop; nexthop; - nexthop = nexthop->next) { + for (ALL_NEXTHOPS(re->ng, nexthop)) { if (rnh_nexthop_valid(nexthop)) break; } @@ -911,7 +913,7 @@ static int send_client(struct rnh *rnh, struct zserv *client, rnh_type_t type, num = 0; nump = stream_get_endp(s); stream_putc(s, 0); - for (nh = re->ng.nexthop; nh; nh = nh->next) + for (ALL_NEXTHOPS(re->ng, nh)) if (rnh_nexthop_valid(nh)) { stream_putl(s, nh->vrf_id); stream_putc(s, nh->type);