nat and ipv6 in fwb_ipt

This commit is contained in:
Vadim Kurland
2008-05-27 18:12:58 +00:00
parent 122300a7bf
commit 08a8e20052
5 changed files with 675 additions and 90 deletions
+14 -4
View File
@@ -342,8 +342,13 @@ void instDialog::prepareInstallerOptions()
if (!aaddr.isEmpty()) if (!aaddr.isEmpty())
cnf.maddr = aaddr; cnf.maddr = aaddr;
else else
cnf.maddr = {
cnf.fwobj->getManagementAddress().toString().c_str(); const InetAddr *mgmt_addr = cnf.fwobj->getManagementAddress();
if (mgmt_addr)
cnf.maddr = mgmt_addr->toString().c_str();
else
cnf.maddr = "";
}
} }
setReady(true); setReady(true);
@@ -718,8 +723,13 @@ bool instDialog::doInstallPage(Firewall* f)
if (!aaddr.isEmpty()) if (!aaddr.isEmpty())
cnf.maddr = aaddr; cnf.maddr = aaddr;
else else
cnf.maddr = {
cnf.fwobj->getManagementAddress().toString().c_str(); const InetAddr *mgmt_addr = cnf.fwobj->getManagementAddress();
if (mgmt_addr)
cnf.maddr = mgmt_addr->toString().c_str();
else
cnf.maddr = "";
}
} }
if (fwbdebug) if (fwbdebug)
+4 -1
View File
@@ -217,7 +217,10 @@ void iptAdvancedDialog::accept()
/********************* data for fwbd and install script **************/ /********************* data for fwbd and install script **************/
PolicyInstallScript *pis = mgmt->getPolicyInstallScript(); PolicyInstallScript *pis = mgmt->getPolicyInstallScript();
mgmt->setAddress( *((Firewall::cast(obj))->getAddressPtr()) ); // find first interface marked as "management"
const InetAddr *mgmt_addr = Firewall::cast(obj)->getManagementAddress();
if (mgmt_addr)
mgmt->setAddress(*mgmt_addr);
pis->setCommand( m_dialog->installScript->text().toLatin1().constData() ); pis->setCommand( m_dialog->installScript->text().toLatin1().constData() );
pis->setArguments( m_dialog->installScriptArgs->text().toLatin1().constData() ); pis->setArguments( m_dialog->installScriptArgs->text().toLatin1().constData() );
+6
View File
@@ -2165,6 +2165,11 @@ void NATCompiler_ipt::compile()
// empty rule element. // empty rule element.
add( new dropRuleWithEmptyRE("drop rules with empty rule elements")); add( new dropRuleWithEmptyRE("drop rules with empty rule elements"));
if (ipv6)
add( new DropIPv4Rules("drop ipv4 rules"));
else
add( new DropIPv6Rules("drop ipv6 rules"));
add( new eliminateDuplicatesInOSRC("eliminate duplicates in OSRC")); add( new eliminateDuplicatesInOSRC("eliminate duplicates in OSRC"));
add( new eliminateDuplicatesInODST("eliminate duplicates in ODST")); add( new eliminateDuplicatesInODST("eliminate duplicates in ODST"));
add( new eliminateDuplicatesInOSRV("eliminate duplicates in OSRV")); add( new eliminateDuplicatesInOSRV("eliminate duplicates in OSRV"));
@@ -2229,6 +2234,7 @@ void NATCompiler_ipt::compile()
add( new DropIPv4Rules("drop ipv4 rules")); add( new DropIPv4Rules("drop ipv4 rules"));
else else
add( new DropIPv6Rules("drop ipv6 rules")); add( new DropIPv6Rules("drop ipv6 rules"));
add( new dropRuleWithEmptyRE("drop rules with empty rule elements")); add( new dropRuleWithEmptyRE("drop rules with empty rule elements"));
add( new specialCaseWithUnnumberedInterface( add( new specialCaseWithUnnumberedInterface(
+15 -12
View File
@@ -3008,25 +3008,28 @@ bool PolicyCompiler_ipt::removeFW::processNext()
if (compiler->osconfigurator->getNumOfVirtualAddressesForNat()==0 && if (compiler->osconfigurator->getNumOfVirtualAddressesForNat()==0 &&
! rule->getBool("upstream_rule_neg") ) ! rule->getBool("upstream_rule_neg") )
{ {
RuleElementSrc *srcrel=rule->getSrc(); RuleElementSrc *srcrel = rule->getSrc();
Address *src =compiler->getFirstSrc(rule); Address *src = compiler->getFirstSrc(rule);
if (src==NULL) if (src==NULL) compiler->abort(
compiler->abort(string("removeFW: Empty Source rule element in rule ") + string("removeFW: Empty Source rule element in rule ") +
rule->getLabel()); rule->getLabel());
RuleElementDst *dstrel=rule->getDst();
Address *dst =compiler->getFirstDst(rule); RuleElementDst *dstrel = rule->getDst();
if (dst==NULL) Address *dst = compiler->getFirstDst(rule);
compiler->abort(string("removeFW: Empty Destination rule element in rule ") + if (dst==NULL) compiler->abort(
rule->getLabel()); string("removeFW: Empty Destination rule element in rule ") +
rule->getLabel());
if (( rule->getStr("ipt_chain")=="INPUT" || if (( rule->getStr("ipt_chain")=="INPUT" ||
rule->getStr("upstream_rule_chain")=="INPUT") && dst->getId()==compiler->getFwId() ) rule->getStr("upstream_rule_chain")=="INPUT") &&
dst->getId()==compiler->getFwId() )
{ {
dstrel->reset(); dstrel->reset();
} }
if (( rule->getStr("ipt_chain")=="OUTPUT" || if (( rule->getStr("ipt_chain")=="OUTPUT" ||
rule->getStr("upstream_rule_chain")=="OUTPUT") && src->getId()==compiler->getFwId() ) rule->getStr("upstream_rule_chain")=="OUTPUT") &&
src->getId()==compiler->getFwId() )
{ {
srcrel->reset(); srcrel->reset();
} }
File diff suppressed because it is too large Load Diff