HomeFreeBSD

ipfw: add additional handling for orphaned states

Description

ipfw: add additional handling for orphaned states

When parent rule of dynamic state is deleted and
net.inet.ip.fw.dyn_keep_states is enabled, dynamic states are kept
working and such states are called ORPHANED.
Orphaned states still keep pointer to original parent rule. And in
case when rule action is skipto this can lead to unpredictable
consequences. To avoid this problem add special handling for skipto
action when we have found ORPHANED state.
Check that new rule has the same opcode and skipto number for
O_SKIPTO rule action.

Obtained from: Yandex LLC
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D51459

Details

Provenance
aeAuthored on Jul 22 2025, 8:12 AM
Differential Revision
D51459: ipfw: add additional check for orphaned states
Parents
rG91ed876385d4: ipfw: forbid adding keep-state rules that depend on tablearg
Branches
Unknown
Tags
Unknown