mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 05:21:31 +00:00
BGP: Check in multipath comparison before invoking sockunion_cmp
During route selection for Multipath routes, when multiple peers are flapping, it is possible that the old (former) multipath list of routes for a destination may include routes from peers which are no longer in Established state. When the new multipath list is compared against the old list to identify changes, additional checks are needed to avoid comparing connection addresses if the peer is not in Established state. This patch introduces those checks. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Ticket: CM-9671 Reviewed By: CCR-4277 Testing Done: Manual (problem could not be replicated to verify)
This commit is contained in:
parent
e99789d89d
commit
a3cb01d89c
@ -188,7 +188,16 @@ bgp_info_mpath_cmp (void *val1, void *val2)
|
||||
compare = bgp_info_nexthop_cmp (bi1, bi2);
|
||||
|
||||
if (!compare)
|
||||
compare = sockunion_cmp (bi1->peer->su_remote, bi2->peer->su_remote);
|
||||
{
|
||||
if (!bi1->peer->su_remote && !bi2->peer->su_remote)
|
||||
compare = 0;
|
||||
else if (!bi1->peer->su_remote)
|
||||
compare = 1;
|
||||
else if (!bi2->peer->su_remote)
|
||||
compare = -1;
|
||||
else
|
||||
compare = sockunion_cmp (bi1->peer->su_remote, bi2->peer->su_remote);
|
||||
}
|
||||
|
||||
return compare;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user