Page MenuHomeFreeBSD

Implement net.inet.ip.fw.dyn_keep_states for all rule actions, not just for default_to_accept case
ClosedPublic

Authored by ae on Oct 12 2018, 12:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 2:12 PM
Unknown Object (File)
Tue, Nov 12, 1:34 AM
Unknown Object (File)
Sun, Nov 3, 11:53 AM
Unknown Object (File)
Oct 17 2024, 2:09 AM
Unknown Object (File)
Oct 10 2024, 1:30 AM
Unknown Object (File)
Oct 7 2024, 5:10 PM
Unknown Object (File)
Oct 4 2024, 5:25 AM
Unknown Object (File)
Sep 27 2024, 2:41 AM
Subscribers

Details

Summary

The net.inet.ip.fw.dyn_keep_states sysctl variable allows to keep dynamic states when parent rule is deleted. But it works only when the default rule is "allow from any to any". The proposed patch reworks this. Now when rule with dynamic opcode is going to be deleted, and net.inet.ip.fw.dyn_keep_states is enabled, existing states will reference named objects, corresponding to this rule, and also reference the rule.
So, when ipfw_dyn_lookup_state() will find state for deleted parent rule, it will return the pointer to the deleted rule, that is still valid.
Also now it is possible to delete only specified dynamic states without touching static rules using -D flag with ipfw(8).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20159
Build 19650: arc lint + arc unit

Event Timeline

Correct the size of allocated buffer to keep bitmask

added verbose mode for listing dynamic states
added ability to delete only dynamic states

ae added a reviewer: network.
This revision was not accepted when it landed; it landed in state Needs Review.Dec 4 2018, 4:03 PM
This revision was automatically updated to reflect the committed changes.