HomeFreeBSD

ipfw: Skip to the start of the loop when following a keep-state rule

Description

ipfw: Skip to the start of the loop when following a keep-state rule

When a packet matches an existing dynamic rule for a keep-state rule,
the matching engine advances the "instruction pointer" to the action
portion of the rule skipping over the match conditions. However, the
code was merely breaking out of the switch statement rather than doing
a continue, so the remainder of the loop body after the switch was
still executed. If the first action opcode contains an F_NOT but not
an F_OR (such as an "untag" action), then match is toggled to 0, and
the code exits the inner loop via a break which aborts processing of
the actions.

To fix, just use a continue instead of a break.

PR: 276732
Reviewed by: jhb, ae
MFC after: 2 weeks

Details

Provenance
Karim Fodil-Lemelin <kfl@xiplink.com>Authored on Feb 16 2024, 1:57 AM
jhbCommitted on Feb 16 2024, 1:57 AM
Parents
rGfeefc3c71e33: pci_host_generic: Properly handle bus_release_resource of IRQ resources
Branches
Unknown
Tags
Unknown