Page MenuHomeFreeBSD

pf: inline pf_addrcpy()
ClosedPublic

Authored by kp on Mar 30 2025, 7:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 24, 6:23 PM
Unknown Object (File)
Mon, Nov 24, 6:23 PM
Unknown Object (File)
Mon, Nov 24, 6:23 PM
Unknown Object (File)
Mon, Nov 24, 6:22 PM
Unknown Object (File)
Wed, Nov 5, 11:01 PM
Unknown Object (File)
Wed, Nov 5, 7:53 PM
Unknown Object (File)
Wed, Nov 5, 1:58 AM
Unknown Object (File)
Tue, Nov 4, 9:48 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.