History log of /freebsd-current/tests/sys/netpfil/pf/divert-to.sh
Revision Date Author Comments
# b453e3f7 19-Nov-2023 Igor Ostapenko <pm@igoro.pro>

pf tests: fix name and description of divert-to cases

Reflect the correct order of events for dummynet+ipdivert.


# fe3bb40b 17-Nov-2023 Igor Ostapenko <pm@igoro.pro>

pf: fix dummynet + ipdivert use case

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
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D42609


# fabf705f 18-Oct-2023 Igor Ostapenko <pm@igoro.pro>

pf: fix pf divert-to loop

Resolved conflict between ipfw and pf if both are used and pf wants to
do divert(4) by having separate mtags for pf and ipfw.

Also fix the incorrect 'rulenum' check, which caused the reported loop.

While here add a few test cases to ensure that divert-to works as
expected, even if ipfw is loaded.

divert(4)
PR: 272770
MFC after: 3 weeks
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D42142