HomeFreeBSD

pf: fix pf divert-to loop

Description

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

(cherry picked from commit fabf705f4b5aff2fa2dc997c2d0afd62a6927e68)

Details

Provenance
igor.ostapenko_pm.meAuthored on Oct 19 2023, 10:12 AM
kpCommitted on Nov 9 2023, 9:55 AM
Reviewer
kp
Differential Revision
D42142: Fix pf divert-to loop
Parents
rGd2c65a1c9486: fflush: correct buffer handling in __sflush
Branches
Unknown
Tags
Unknown