Page MenuHomeFreeBSD

pf: Track the original kif for floating states
ClosedPublic

Authored by kp on May 13 2021, 11:49 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 8:06 AM
Unknown Object (File)
Fri, Apr 19, 7:09 AM
Unknown Object (File)
Mon, Apr 8, 10:57 AM
Unknown Object (File)
Jan 15 2024, 3:39 AM
Unknown Object (File)
Dec 23 2023, 2:37 AM
Unknown Object (File)
Dec 20 2023, 8:53 AM
Unknown Object (File)
Dec 17 2023, 6:53 PM
Unknown Object (File)
Nov 8 2023, 7:13 AM

Details

Summary

Track (and display) the interface that created a state, even if it's a
floating state (and thus uses virtual interface 'all').

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

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

Event Timeline

kp requested review of this revision.May 13 2021, 11:49 AM
eri requested changes to this revision.May 13 2021, 3:21 PM
eri added a subscriber: eri.

Why can't you move the interface 'all' to be a flag and just always track the interface the packet came in originally?

sbin/pfctl/pf_print_state.c
355

Is the whitespace here intentional?

359

Can you avoid strcmp even though existing code has it?

sys/net/pfvar.h
525

Is this an ABI change? If yes, would recommend to note this somewhere or even better add this to the end of pf_state to avoid the breakage.

This revision now requires changes to proceed.May 13 2021, 3:21 PM
sbin/pfctl/pf_print_state.c
355

Yes. There was more whitespace there than there was supposed to be (it's on the same line as id / creatorid) so I'm removing that while we're here.

359

I don't follow. The intent here is to only display 'origif' if it's different from the ifname we've already printed. I.e. when we're a floating state.

sys/net/pfvar.h
525

It's a pf-internal change. The state structure is guarded by #ifdef _KERNEL. Although that's somewhat recent, the pf_state structure hasn't been directly accessible to userspace for many years. We do share this data as part of pfsync, but there's a separate export function to convert it, which isn't changed.

This revision was not accepted when it landed; it landed in state Needs Revision.May 20 2021, 11:55 AM
This revision was automatically updated to reflect the committed changes.