mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-22 03:07:20 +01:00
bugfix in dropRuleWithEmptyRE, fix in swapMultiAddressObjectsInRE (need to add MultiAddressRunTime object to compiler cache)
This commit is contained in:
parent
3798b71c9c
commit
7e26139beb
@ -360,7 +360,7 @@ void Compiler::expandGroupsInRuleElement(RuleElement *s)
|
||||
FWObject *o= *i1;
|
||||
if (FWReference::cast(o)!=NULL) o=FWReference::cast(o)->getPointer();
|
||||
assert(o);
|
||||
_expand_group_recursive(o,cl);
|
||||
_expand_group_recursive(o, cl);
|
||||
}
|
||||
|
||||
s->clearChildren();
|
||||
@ -1260,8 +1260,8 @@ bool Compiler::swapMultiAddressObjectsInRE::processNext()
|
||||
MultiAddress *ma = *i;
|
||||
|
||||
string mart_id = ma->getId()+"_runtime";
|
||||
MultiAddressRunTime *mart =
|
||||
MultiAddressRunTime::cast(compiler->dbcopy->findInIndex(mart_id));
|
||||
MultiAddressRunTime *mart = MultiAddressRunTime::cast(
|
||||
compiler->dbcopy->findInIndex(mart_id));
|
||||
if (mart==NULL)
|
||||
{
|
||||
mart = new MultiAddressRunTime(ma);
|
||||
@ -1275,6 +1275,7 @@ bool Compiler::swapMultiAddressObjectsInRE::processNext()
|
||||
mart->setId( mart_id );
|
||||
compiler->dbcopy->addToIndex(mart);
|
||||
compiler->dbcopy->add(mart);
|
||||
compiler->cacheObj(mart);
|
||||
}
|
||||
re->removeRef(ma);
|
||||
re->addRef(mart);
|
||||
|
||||
@ -699,12 +699,14 @@ bool NATCompiler::dropRuleWithEmptyRE::processNext()
|
||||
RuleElementTDst *tdstrel = rule->getTDst();
|
||||
if ((osrcrel->size() == 0) || (odstrel->size() == 0)) return true;
|
||||
if ((tsrcrel->size() == 0) || (tdstrel->size() == 0)) return true;
|
||||
Address *osrc = compiler->getFirstOSrc(rule);
|
||||
Address *odst = compiler->getFirstODst(rule);
|
||||
Address *tsrc = compiler->getFirstTSrc(rule);
|
||||
Address *tdst = compiler->getFirstTDst(rule);
|
||||
if (osrc!=NULL && odst!=NULL && tsrc!=NULL && tdst!=NULL)
|
||||
tmp_queue.push_back(rule);
|
||||
// Address *osrc = compiler->getFirstOSrc(rule);
|
||||
// Address *odst = compiler->getFirstODst(rule);
|
||||
// Address *tsrc = compiler->getFirstTSrc(rule);
|
||||
// Address *tdst = compiler->getFirstTDst(rule);
|
||||
// if (osrc!=NULL && odst!=NULL && tsrc!=NULL && tdst!=NULL)
|
||||
// tmp_queue.push_back(rule);
|
||||
|
||||
tmp_queue.push_back(rule);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user