do not generate "-m icmp6 --icmp6-type any" for ipv6

This commit is contained in:
Vadim Kurland
2008-06-30 18:43:57 +00:00
parent a009e6730e
commit db79b92d4c
2 changed files with 10 additions and 2 deletions
+6
View File
@@ -1,3 +1,9 @@
2008-06-30 Vadim Kurland <vadim@vk.crocodile.org>
* PolicyCompiler_PrintRule.cpp (PrintRule::_printProtocol): do not
generate "-m icmp6 --icmp6-type any" for ipv6 for object "any
icmp".
2008-06-28 Vadim Kurland <vadim@vk.crocodile.org>
* DiscoveryDruid.cpp (DiscoveryDruid::loadDataFromDNS): object
+4 -2
View File
@@ -604,7 +604,8 @@ string PolicyCompiler_ipt::PrintRule::_printProtocol(libfwbuilder::Service *srv)
if (pn == "icmp")
{
s = "-p ipv6-icmp ";
if (ipt_comp->newIptables(version)) s += " -m icmp6";
if (srv->getInt("type")!=-1 &&
ipt_comp->newIptables(version)) s += " -m icmp6";
} else
{
// ip6tables issues warning for commands using "-p all"
@@ -857,7 +858,8 @@ string PolicyCompiler_ipt::PrintRule::_printDstService(RuleElementSrv *rel)
string str = _printICMP( ICMPService::cast(srv) );
if (str.empty() )
{
if (ipt_comp->newIptables(version))
// module icmp6 does not like "--icmp6-type any"
if (ipt_comp->newIptables(version) && !ipt_comp->ipv6)
ostr << icmp_type_str << " any ";
} else
{