mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 17:13:46 +00:00
Merge pull request #16562 from FRRouting/mergify/bp/stable/9.1/pr-16554
zebra: Ensure non-equal id's are not same nhg's (backport #16554)
This commit is contained in:
commit
00d1dbaede
@ -535,9 +535,18 @@ bool zebra_nhg_hash_equal(const void *arg1, const void *arg2)
|
||||
struct nexthop *nexthop1;
|
||||
struct nexthop *nexthop2;
|
||||
|
||||
/* No matter what if they equal IDs, assume equal */
|
||||
if (nhe1->id && nhe2->id && (nhe1->id == nhe2->id))
|
||||
return true;
|
||||
/* If both NHG's have id's then we can just know that
|
||||
* they are either identical or not. This comparison
|
||||
* is only ever used for hash equality. NHE's id
|
||||
* is sufficient to distinguish them. This is especially
|
||||
* true if NHG's are owned by an upper level protocol.
|
||||
*/
|
||||
if (nhe1->id && nhe2->id) {
|
||||
if (nhe1->id == nhe2->id)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (nhe1->type != nhe2->type)
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user