HomeFreeBSD

libpfctl: fix file descriptor leak

Description

libpfctl: fix file descriptor leak

pfctl_get_rules_info() opened a netlink socket, but failed to close it again.
Fix this by factoring out the netlink-based function into a _h variant that
takes struct pfctl_handle, and implement pfctl_get_rules_info() based on that,
remembering to close the fd.

While here migrate all in-tree consumers to the _h variant.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

Details

Provenance
kpAuthored on May 9 2024, 11:52 AM
Parents
rGee72bc1d1ff8: xen/debug: remove usage of sbuf_{clear,finish}() on drained sbuf
Branches
Unknown
Tags
Unknown