mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 22:10:19 +00:00
bgpd: upon if event, evaluate bnc with matching nexthop
In BGP, when an interface event is detected or triggered, the BNC that have a next-hop that matches the interface are not evaluated. The paths attached to the bnc context are evaluated in the following situation: - In the up event case, if at least one next-hop interface matched the event interface. - In the down event case, if there is no alternate next-hop that does not use the event interface. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
parent
713831fa7f
commit
4f725062a4
@ -707,9 +707,40 @@ static void bgp_nht_ifp_table_handle(struct bgp *bgp,
|
|||||||
struct interface *ifp, bool up)
|
struct interface *ifp, bool up)
|
||||||
{
|
{
|
||||||
struct bgp_nexthop_cache *bnc;
|
struct bgp_nexthop_cache *bnc;
|
||||||
|
struct nexthop *nhop;
|
||||||
|
uint8_t other_nh_count;
|
||||||
|
bool nhop_found;
|
||||||
|
|
||||||
frr_each (bgp_nexthop_cache, table, bnc) {
|
frr_each (bgp_nexthop_cache, table, bnc) {
|
||||||
if (bnc->ifindex_ipv6_ll != ifp->ifindex)
|
other_nh_count = 0;
|
||||||
|
nhop_found = bnc->ifindex_ipv6_ll == ifp->ifindex;
|
||||||
|
for (nhop = bnc->nexthop; nhop; nhop = nhop->next) {
|
||||||
|
if (nhop->ifindex == bnc->ifindex_ipv6_ll)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (nhop->ifindex != ifp->ifindex) {
|
||||||
|
other_nh_count++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (nhop->vrf_id != ifp->vrf->vrf_id) {
|
||||||
|
other_nh_count++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
nhop_found = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!nhop_found)
|
||||||
|
/* The event interface does not match the nexthop cache
|
||||||
|
* entry */
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!up && other_nh_count > 0)
|
||||||
|
/* Down event ignored in case of multiple next-hop
|
||||||
|
* interfaces. The other might interfaces might be still
|
||||||
|
* up. The cases where all interfaces are down or a bnc
|
||||||
|
* is invalid are processed by a separate zebra rnh
|
||||||
|
* messages.
|
||||||
|
*/
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bnc->last_update = monotime(NULL);
|
bnc->last_update = monotime(NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user