Page MenuHomeFreeBSD

Move ipfilter from contrib to netpfil and sbin
ClosedPublic

Authored by cy on Dec 16 2021, 4:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 11:11 AM
Unknown Object (File)
Thu, Oct 24, 5:30 PM
Unknown Object (File)
Oct 17 2024, 8:58 AM
Unknown Object (File)
Oct 5 2024, 8:54 AM
Unknown Object (File)
Oct 1 2024, 7:35 PM
Unknown Object (File)
Oct 1 2024, 5:36 PM
Unknown Object (File)
Oct 1 2024, 5:26 PM
Unknown Object (File)
Oct 1 2024, 3:48 PM
Subscribers

Details

Summary

Gleb Smirnoff (glebius) suggested (twice) that since we're (I'm) putting a lot of work into ipfilter, it would be more appropriate to move it to netpfil. This patch, which is three separate commits in a branch, does this.

The three commits are:

  1. Move sys/contrib/ipfilter to sys/netpfil.
  2. Move contrib/ipfilter to /sbin/ipf.
  3. Remove remaining bits

The structure remains basically the same, sys/net/pfil/ipfilter/netinet. The reason for this is the code references headers in netinet. I could put the *.c files in sys/net/pfil/ipfilter and the headers in the netinet subdirectory instead. I have considered flattening it out but since we still share code with NetBSD changing the structure too drastically will make it more difficult to share patches. But I'm open to be convinced.

I will need some help with Makefile.depend in places.

Please add anyone else who could help review this.

Test Plan

A make universe has passed with RC=0.

I intend to merge this into my "prod" tree and run it here for a while.

Diff Detail

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

Event Timeline

cy requested review of this revision.Dec 16 2021, 4:37 PM

I have no objections to the move (or much feedback to offer on the build changes required. I've very carefully avoided learning about our build system.).

One request though: please try to make sure that each individual commit actually builds. Non-building commits make bisects harder than they need to be.

Yes, that has already been tested. All three commits build by themselves.

Phabricator isn't able to show this revision. Are you sharing your own git anywhere, e.g. github? Looking at actual commits would be much better.

You can find it here --> https://github.com/cschuber/freebsd-ipf-move.git. In that repo the commits were merged into main to avoid any confusion.

This revision is now accepted and ready to land.Dec 17 2021, 4:06 PM

You can find it here --> https://github.com/cschuber/freebsd-ipf-move.git. In that repo the commits were merged into main to avoid any confusion.

Looks good to me. Seems to came out easier than pf(4) some time ago.

I've just tried to update with the Phabricator patch ('git arc apply D....'), and while it builds okay it failed during the install step:

install  -o root  -g wheel -m 0755  /usr/src/share/examples/ipfilter/mkfilters  /usr/share/examples/ipfilter/mkfilters
install: /usr/src/share/examples/ipfilter/mkfilters: Inappropriate file type or format
*** [_SCRIPTSINS_mkfilters] Error code 71

make[6]: stopped in /usr/src/share/examples/ipfilter

make[3]: stopped in /usr/src
--- realinstall_subdir_include ---

Perhaps git-arc messed something up, or perhaps there's a deeper issue.

I see the problem. share/examples/ipfilter/mkfilter needs to be flattened. I'll upload a new diff. Sorry about t hat.

Flattened share/examples/ipfilter/mkfilters.

Merged into my "prod" repo (git filter-patch; git am). Installed and running here now.

This revision now requires review to proceed.Dec 17 2021, 6:44 PM

ipresend, which was disconnected from the build prior to this revision, needed a .PATH change.

This builds, installs & passes tests for me.

This revision was not accepted when it landed; it landed in state Needs Review.Dec 20 2021, 2:18 PM
This revision was automatically updated to reflect the committed changes.