Page MenuHomeFreeBSD

pf: fix dummynet + ipdivert use case
ClosedPublic

Authored by igoro on Nov 15 2023, 12:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 20, 1:41 PM
Unknown Object (File)
Oct 6 2024, 1:20 AM
Unknown Object (File)
Sep 27 2024, 6:18 PM
Unknown Object (File)
Sep 21 2024, 5:01 AM
Unknown Object (File)
Sep 18 2024, 4:07 AM
Unknown Object (File)
Sep 17 2024, 6:04 PM
Unknown Object (File)
Sep 9 2024, 11:24 PM
Unknown Object (File)
Sep 6 2024, 1:29 PM

Details

Summary
Dummynet re-injects an mbuf with MTAG_IPFW_RULE added, and the same mtag
is used by divert(4) as parameters for packet diversion.

If according to pf rule set a packet should go through dummynet first
and through ipdivert after then mentioned mtag must be removed after
dummynet not to make ipdivert think that this is its input parameters.

At the very beginning ipfw consumes this mtag what means the same
behavior with tag clearing after dummynet.

And after fabf705f4b5a pf passes parameters to ipdivert using its
personal MTAG_PF_DIVERT mtag.
    
PR:             274850

Diff Detail

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

Event Timeline

This seems sane to me (and the existing tests pass, which is a nice thing to have).

Two minor remarks, more about taste than actual issues.

sys/netpfil/pf/pf.c
306

I'd call that pf_dummynet_flag_remove() or something

tests/sys/netpfil/pf/Makefile
11 ↗(On Diff #130104)

I'd put this in the existing divert-to tests file.

igoro edited the summary of this revision. (Show Details)

Sure, it makes sense. Please, consider the second version of the patch.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 17 2023, 5:07 PM
Closed by commit rGfe3bb40b9e80: pf: fix dummynet + ipdivert use case (authored by igoro, committed by kp). · Explain Why
This revision was automatically updated to reflect the committed changes.