mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-19 22:30:31 +00:00
lib: fix prefix list trie corruption
The specific code here needs to establish an absolute order of more specific to less specific possible matches in a prefix list. This is indirectly checked by an assert on insertion, because the "next best" entry is required to be consistent even when joining multiple chains of candidates. Unfortunately, trie_install_fn() would insert entries too far ahead in the chain if another entry with higher sequence number was seen. This breaks the trie and (rightfully) triggers the assertion failure on insert. Fixes: #937 Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
c47b10cae1
commit
6ac011aaad
@ -538,7 +538,8 @@ static void trie_install_fn(struct prefix_list_entry *object,
|
||||
return;
|
||||
if ((*updptr)->prefix.prefixlen < object->prefix.prefixlen)
|
||||
break;
|
||||
if ((*updptr)->seq > object->seq)
|
||||
if ((*updptr)->prefix.prefixlen == object->prefix.prefixlen
|
||||
&& (*updptr)->seq > object->seq)
|
||||
break;
|
||||
updptr = &(*updptr)->next_best;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user