bgpd: fix do not use api.backup_nexthop in ZAPI message

The backup_nexthop entry list has been populated by mistake,
and should not. Fix this by reverting the introduced behavior.

Fixes: 237ebf8d45 ("bgpd: rework bgp_zebra_announce() function, separate nexthop handling")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit d4390fc217)
This commit is contained in:
Philippe Guibert 2024-06-20 18:02:26 +02:00 committed by Mergify
parent 84bbd169d9
commit ae546b0921

View File

@ -1286,10 +1286,7 @@ static void bgp_zebra_announce_parse_nexthop(
&nh_weight)) &nh_weight))
continue; continue;
} }
if (CHECK_FLAG(info->flags, BGP_PATH_SELECTED))
api_nh = &api->nexthops[*valid_nh_count]; api_nh = &api->nexthops[*valid_nh_count];
else
api_nh = &api->backup_nexthops[*valid_nh_count];
if (CHECK_FLAG(info->attr->flag, if (CHECK_FLAG(info->attr->flag,
ATTR_FLAG_BIT(BGP_ATTR_SRTE_COLOR))) ATTR_FLAG_BIT(BGP_ATTR_SRTE_COLOR)))