Page MenuHomeFreeBSD

pf: Prevent infinite looping over tables in round-robin pools
ClosedPublic

Authored by vegeta_tuxpowered.net on Jun 10 2025, 3:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 22, 1:35 PM
Unknown Object (File)
Sat, Sep 13, 4:06 AM
Unknown Object (File)
Sep 8 2025, 10:00 AM
Unknown Object (File)
Sep 5 2025, 8:01 AM
Unknown Object (File)
Aug 19 2025, 8:23 PM
Unknown Object (File)
Aug 13 2025, 11:49 PM
Unknown Object (File)
Aug 12 2025, 8:37 PM
Unknown Object (File)
Aug 12 2025, 3:22 AM

Details

Summary

In FreeBSD each redirection pool (struct pf_kpool) consists of multiple
hosts (struct pf_addr_wrap). In OpenBSD that is not the case, and a
round-robin pool having a table as a host loops infinitely only over
that single table.

In FreeBSD once all addresses from a table are returned the pool must
iterate to the next host. Add a custom flag to have pfr_pool_get() break
its loop once it reaches the last index. Use this flag in round-robin
pools. When changing pool's host set index to 0 to always start
iterating each table from beginning.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable