Page MenuHomeFreeBSD

pf: inline pf_addrcpy()
ClosedPublic

Authored by kp on Mar 30 2025, 7:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 24, 9:11 PM
Unknown Object (File)
Fri, Apr 24, 6:49 AM
Unknown Object (File)
Thu, Apr 23, 6:33 PM
Unknown Object (File)
Thu, Apr 23, 2:26 PM
Unknown Object (File)
Wed, Apr 22, 9:23 PM
Unknown Object (File)
Tue, Apr 21, 10:53 AM
Unknown Object (File)
Mon, Apr 20, 3:19 AM
Unknown Object (File)
Sun, Apr 19, 6:03 PM

Details

Summary

Make it easier for the compiler to inline this in the many cases where the 'af'
is known at compile time.

Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

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

Event Timeline

kp requested review of this revision.Mar 30 2025, 7:55 PM

Sidenote: how far are we from not installing pfvar.h into /usr/include/net or maybe not installing it at all?

sys/net/pfvar.h
602

You don't need underscores in front of inline for private headers. It is C keyword with modern standards.

This revision is now accepted and ready to land.Mar 30 2025, 11:26 PM
sys/net/pfvar.h
602

Even if this header is nominally private, some public header might include it, and this bit is not guarded by _KERNEL, I believe. (And there are ioctl definitions in pfvar.h, so how can it be private?)

Probably the right thing is to make this function conditional on _KERNEL, if it isn't already. Then yes, the plain inline keyword can be used.

This revision was automatically updated to reflect the committed changes.