Page MenuHomeFreeBSD

pfctl: Stop sharing pf_ruleset.c with the kernel
ClosedPublic

Authored by kp on Dec 24 2020, 3:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 7:33 PM
Unknown Object (File)
Sun, Apr 21, 7:33 PM
Unknown Object (File)
Sun, Apr 21, 7:33 PM
Unknown Object (File)
Sun, Apr 21, 7:33 PM
Unknown Object (File)
Thu, Apr 18, 3:23 PM
Unknown Object (File)
Mar 4 2024, 8:24 AM
Unknown Object (File)
Feb 16 2024, 10:26 AM
Unknown Object (File)
Feb 4 2024, 1:03 PM

Details

Summary

Now that we've split up the datastructures used by the kernel and
userspace there's essentually no more overlap between the pf_ruleset.c
code used by userspace and kernelspace.

Copy the userspace bits to the pfctl directory and stop using the kernel
file.

MFC after: 2 weeks
Sponsored by: Orange Business Services

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 35792
Build 32681: arc lint + arc unit

Event Timeline

kp requested review of this revision.Dec 24 2020, 3:49 PM

If there are no objections to this series (D27707, D27756 - D27764) I'm going to push this tomorrow.

Given, that the old file was included by user space programms, I'd suggest to include some lines like

#ifndef KERNEL
# error "Kernel only file! Please include ...."
#endif
This revision is now accepted and ready to land.Dec 30 2020, 11:15 AM

Fail build if the kernel file is used in userspace.

This revision now requires review to proceed.Dec 30 2020, 2:46 PM

Still looks good to me.

This patch series is likely to be very upsetting to pftop. Though I think it was already broken. Maybe the #error will nudge someone to fix it?

This revision is now accepted and ready to land.Dec 31 2020, 12:16 AM

Still looks good to me.

This patch series is likely to be very upsetting to pftop. Though I think it was already broken. Maybe the #error will nudge someone to fix it?

It appears to still just build and work, at least with some basic testing.
This patch is the most visible to userspace, because userspace is now expected to no longer use kernel files (ick, ick, ew). The ioctl interface for pf is entirely unchanged, at least as far as userspace can tell.
A few definitions moved around in the header files, but pfvar.h includes pf.h, so that doesn't really matter either.

This revision was automatically updated to reflect the committed changes.