Commit 700e3514 authored by Ad Schellevis's avatar Ad Schellevis

(filter) reverse inet46 handling

parent 89c55e1b
...@@ -164,14 +164,18 @@ class FilterRule ...@@ -164,14 +164,18 @@ class FilterRule
$result = array(); $result = array();
$interfaces = empty($this->rule['interface']) ? array(null) : explode(',', $this->rule['interface']); $interfaces = empty($this->rule['interface']) ? array(null) : explode(',', $this->rule['interface']);
foreach ($interfaces as $interface) { foreach ($interfaces as $interface) {
$tmp = $this->rule; if (isset($this->rule['ipprotocol']) && $this->rule['ipprotocol'] == 'inet46') {
// protocol handling $ipprotos = array('inet', 'inet6');
if (empty($this->rule['ipprotocol']) || $this->rule['ipprotocol'] == 'inet46') { } elseif (isset($this->rule['ipprotocol'])) {
$tmp['ipprotocol'] = ""; $ipprotos = array($this->rule['ipprotocol']);
} else { } else {
$tmp['ipprotocol'] = $this->rule['ipprotocol']; $ipprotos = array(null);
} }
foreach ($ipprotos as $ipproto) {
$tmp = $this->rule;
$tmp['interface'] = $interface; $tmp['interface'] = $interface;
$tmp['ipprotocol'] = $ipproto;
// disable rule when interface not found // disable rule when interface not found
if (!empty($interface) && empty($this->interfaceMapping[$interface]['if'])) { if (!empty($interface) && empty($this->interfaceMapping[$interface]['if'])) {
$tmp['disabled'] = true; $tmp['disabled'] = true;
...@@ -212,6 +216,7 @@ class FilterRule ...@@ -212,6 +216,7 @@ class FilterRule
} }
$result[] = $tmp; $result[] = $tmp;
} }
}
return $result; return $result;
} }
......
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