Page MenuHomeFreeBSD

pctrie: leave pctrie top as current after [gl]e_lookup failure
ClosedPublic

Authored by dougm on Jul 10 2025, 2:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 7, 8:38 PM
Unknown Object (File)
Tue, Oct 6, 12:21 PM
Unknown Object (File)
Mon, Oct 5, 12:24 AM
Unknown Object (File)
Sat, Oct 3, 4:32 AM
Unknown Object (File)
Fri, Oct 2, 7:20 PM
Unknown Object (File)
Thu, Oct 1, 9:39 PM
Unknown Object (File)
Thu, Oct 1, 4:01 PM
Unknown Object (File)
Wed, Sep 30, 12:02 AM
Subscribers

Details

Summary

If pctrie_lookup_iter_ge fails to return a node, the iterator is left with NULL as the current node. Instead, make the top of the tree the current node. Do the same thing for lookup_iter_le. If an iterator is reused after a ge/le lookup fails, this will skip the step in _pctrie_lookup_node where a NULL is replaced by the node at the top of the trie.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

dougm requested review of this revision.Jul 10 2025, 2:40 AM
dougm created this revision.

Handle the case where the pctrie is empty.

This revision is now accepted and ready to land.Jul 10 2025, 7:53 AM