Page MenuHomeFreeBSD

pfsync: Correctly check if bpf peers are present
ClosedPublic

Authored by zlei on Jun 7 2024, 6:04 PM.
Tags
None
Referenced Files
F160383398: D45533.diff
Tue, Jun 23, 11:16 PM
Unknown Object (File)
Sat, Jun 20, 8:41 PM
Unknown Object (File)
Fri, Jun 19, 9:48 PM
Unknown Object (File)
Thu, Jun 18, 1:55 PM
Unknown Object (File)
Fri, Jun 5, 9:23 AM
Unknown Object (File)
May 11 2026, 2:02 AM
Unknown Object (File)
May 11 2026, 2:01 AM
Unknown Object (File)
May 11 2026, 1:57 AM

Details

Summary

On creating the pfsync(4) interface, pfsync_clone_create() does an
unconditional bpfattach(). Use bpf_peers_present() which was introduced
in commit 16d878cc99ef [1] to check the presence of bpf peers.

This will save a little CPU cycles and memory usage when the synchronisation interface
is not configured and there is no bpf peers present. There should be no functional change.

  1. 16d878cc99ef Fix the following bpf(4) race condition which can result in a panic

MFC after: 1 week

Diff Detail

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