Bug 272455 - pf(4) manpage lists wrong definition for pfi_kif
Summary: pf(4) manpage lists wrong definition for pfi_kif
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Kristof Provost
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-11 22:10 UTC by alex
Modified: 2023-07-19 07:28 UTC (History)
3 users (show)

See Also:


Attachments
Update pfi_kif (1.54 KB, patch)
2023-07-11 22:10 UTC, alex
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description alex 2023-07-11 22:10:20 UTC
Created attachment 243343 [details]
Update pfi_kif

Attached is a patch for 13-STABLE (14- appears slightly different).
Comment 1 Kristof Provost freebsd_committer freebsd_triage 2023-07-12 09:40:36 UTC
Thanks for the report!

I suspect the man page references the OpenBSD version of that struct.
The difference between 13 and 14 is a minor cleanup in the definition, but the actual layout is identical. 
I'm going to use the 14 version, because it's slightly cleaner.

Also, from this and your other report (272459) I'm going to assume you're trying to interact with pf through its ioctl interface. Are you aware of libpfctl (lib/libpfctl in the source tree)? I've been making somewhat regular changes to the API to clean it up and to add features, and your life is going to be a lot easier if you use that library, because using that will take care of (most of) the changes for you.
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-07-12 13:27:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=64b30b7aeb6d0dc48d038b3df033328c8d8c3141

commit 64b30b7aeb6d0dc48d038b3df033328c8d8c3141
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2023-07-12 09:43:43 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2023-07-12 09:43:43 +0000

    pf: fix pfi_kif definition in the man page

    PR:             272455
    Submitted by:   alex@inferiorhumanorgans.com
    MFC after:      1 week

 share/man/man4/pf.4 | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
Comment 3 alex 2023-07-12 22:09:26 UTC
Ah thanks, I've not seen libpfctl.  I'm working in not-C so it's about as much work (perhaps less since memory management is simplified) to shim the ioctl as it is the library.  

I suppose that largely ignores the changes coming down the pike in -CURRENT but given that the project (interactive pf shell) is just a bit of a distraction from a distraction from an attempt at shaking off some coding cobwebs I'm not so concerned with future compatibility.

Insofar as poking at the ioctl interface directly goes the biggest ergonomic issue that I've run into is that some things can be easily molded into an iterator pattern, and some things (e.g. DIOCIGETIFACES) can't.
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-07-19 07:27:51 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=73a079021a6921ac3ff8ea4b2baca5ddb13de645

commit 73a079021a6921ac3ff8ea4b2baca5ddb13de645
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2023-07-12 09:43:43 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2023-07-19 07:26:59 +0000

    pf: fix pfi_kif definition in the man page

    PR:             272455
    Submitted by:   alex@inferiorhumanorgans.com
    MFC after:      1 week

    (cherry picked from commit 64b30b7aeb6d0dc48d038b3df033328c8d8c3141)

 share/man/man4/pf.4 | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-07-19 07:27:55 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e14a1e0029916cc99787ad93fe22dfe304c9d56a

commit e14a1e0029916cc99787ad93fe22dfe304c9d56a
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2023-07-12 09:43:43 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2023-07-19 07:26:55 +0000

    pf: fix pfi_kif definition in the man page

    PR:             272455
    Submitted by:   alex@inferiorhumanorgans.com
    MFC after:      1 week

    (cherry picked from commit 64b30b7aeb6d0dc48d038b3df033328c8d8c3141)

 share/man/man4/pf.4 | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)