On Mon, Sep 14, 2020 at 02:09:27PM +0900, YASUOKA Masahiko wrote: > Make pfctl check if the rtable really exists when parsing the config. I concur, but you can do this with less (duplicated) code.
Instead of copying rdomain_exists() into rtable_exists() with the `rti_domainid' check omitted, tweak (and rename) rdomain_exists() into returning the information whether the given ID is just an rtable. rdomain_exists() merges the "invalid id" and "id is an rtable but not an rdmomain" cases - make those separate return codes, check/adjust existing callers and use it for your new checks.