mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-25 20:57:29 +01:00
* PolicyCompiler_ipf.cpp (SplitDirectionIpfilter::processNext):
fixed bug #2874571: "ipfilter version 3.4.29 issues after introduction of 282860". Optimizations added for PF broke rule generation for ipfilter which does not allow rule without explicit direction specification.
This commit is contained in:
parent
5b5ef4316d
commit
3848a03edb
@ -1,5 +1,11 @@
|
||||
2009-10-13 vadim <vadim@vk.crocodile.org>
|
||||
|
||||
* PolicyCompiler_ipf.cpp (SplitDirectionIpfilter::processNext):
|
||||
fixed bug #2874571: "ipfilter version 3.4.29 issues after
|
||||
introduction of 282860". Optimizations added for PF broke rule
|
||||
generation for ipfilter which does not allow rule without explicit
|
||||
direction specification.
|
||||
|
||||
* FWBSettings.cpp (FWBSettings::getCollapsedRuleGroups): fixed bug
|
||||
#2872365: "problem with group names containing comma". State of
|
||||
the rule group with a comma in the name could not be saved in
|
||||
|
||||
@ -379,6 +379,31 @@ bool PolicyCompiler_ipf::processMultiAddressObjectsInRE::processNext()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PolicyCompiler_ipf::SplitDirectionIpfilter::processNext()
|
||||
{
|
||||
PolicyRule *rule=getNext(); if (rule==NULL) return false;
|
||||
|
||||
if (rule->getDirection()==PolicyRule::Both)
|
||||
{
|
||||
PolicyRule *r= compiler->dbcopy->createPolicyRule();
|
||||
compiler->temp_ruleset->add(r);
|
||||
r->duplicate(rule);
|
||||
r->setDirection(PolicyRule::Inbound);
|
||||
tmp_queue.push_back(r);
|
||||
|
||||
r= compiler->dbcopy->createPolicyRule();
|
||||
compiler->temp_ruleset->add(r);
|
||||
r->duplicate(rule);
|
||||
r->setDirection(PolicyRule::Outbound);
|
||||
tmp_queue.push_back(r);
|
||||
|
||||
} else
|
||||
tmp_queue.push_back(rule);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void PolicyCompiler_ipf::compile()
|
||||
{
|
||||
@ -474,7 +499,7 @@ void PolicyCompiler_ipf::compile()
|
||||
add( new splitIfFirewallInSrc("split rule if firewall is in Src") );
|
||||
add( new splitIfFirewallInDst("split rule if firewall is in Dst") );
|
||||
add( new fillDirection("determine directions") );
|
||||
add( new SplitDirection("split rules with direction 'both'" ) );
|
||||
add( new SplitDirectionIpfilter("split rules with direction 'both'" ) );
|
||||
add( new ExpandMultipleAddresses(
|
||||
"expand objects with multiple addresses") );
|
||||
add( new checkForDynamicInterfacesOfOtherObjects(
|
||||
|
||||
@ -65,6 +65,10 @@ namespace fwcompiler {
|
||||
*/
|
||||
virtual std::string debugPrintRule(libfwbuilder::Rule *rule);
|
||||
|
||||
/**
|
||||
* split rules if direction is "Both"
|
||||
*/
|
||||
DECLARE_POLICY_RULE_PROCESSOR(SplitDirectionIpfilter);
|
||||
|
||||
/**
|
||||
* splits rules with service 'any' because ipf can keep state
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user