Commit 318224cd authored by Ad Schellevis's avatar Ad Schellevis

(filter) align icmp -> icmp6 behaviour in filter_nat_rules_generate

parent 5a54c06b
...@@ -1932,6 +1932,7 @@ function filter_nat_rules_generate(&$FilterIflist) ...@@ -1932,6 +1932,7 @@ function filter_nat_rules_generate(&$FilterIflist)
$localport = " port {$localport}"; $localport = " port {$localport}";
} }
$address_family = !empty($rule['ipprotocol']) ? $rule['ipprotocol'] : "";
switch(strtolower($rule['protocol'])) { switch(strtolower($rule['protocol'])) {
case "tcp/udp": case "tcp/udp":
$protocol = "{ tcp udp }"; $protocol = "{ tcp udp }";
...@@ -1940,12 +1941,14 @@ function filter_nat_rules_generate(&$FilterIflist) ...@@ -1940,12 +1941,14 @@ function filter_nat_rules_generate(&$FilterIflist)
case "udp": case "udp":
$protocol = strtolower($rule['protocol']); $protocol = strtolower($rule['protocol']);
break; break;
case "icmp":
$protocol = $address_family == 'inet6' ? "ipv6-icmp" : $protocol;
$localport = "";
default: default:
$protocol = strtolower($rule['protocol']); $protocol = strtolower($rule['protocol']);
$localport = ""; $localport = "";
break; break;
} }
$address_family = !empty($rule['ipprotocol']) ? $rule['ipprotocol'] : "";
$target = alias_expand($rule['target']); $target = alias_expand($rule['target']);
if (!$target && !isset($rule['nordr'])) { if (!$target && !isset($rule['nordr'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment