mirror of
https://github.com/opnsense/core.git
synced 2026-02-03 20:39:42 -05:00
firewall: remove ether support from anchor registration
This commit is contained in:
parent
d0e53868c5
commit
2f60fcb062
1 changed files with 2 additions and 14 deletions
|
|
@ -220,10 +220,10 @@ class Plugin
|
||||||
* @param bool $quick
|
* @param bool $quick
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function registerAnchor($name, $type = "fw", $priority = 0, $placement = "tail", $quick = false, $ifs = null)
|
public function registerAnchor($name, $type = "fw", $priority = 0, $placement = "tail", $quick = false)
|
||||||
{
|
{
|
||||||
$anchorKey = sprintf("%s.%s.%08d.%08d", $type, $placement, $priority, count($this->anchors));
|
$anchorKey = sprintf("%s.%s.%08d.%08d", $type, $placement, $priority, count($this->anchors));
|
||||||
$this->anchors[$anchorKey] = ['name' => $name, 'quick' => $quick, 'ifs' => $ifs];
|
$this->anchors[$anchorKey] = ['name' => $name, 'quick' => $quick];
|
||||||
ksort($this->anchors);
|
ksort($this->anchors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -239,21 +239,9 @@ class Plugin
|
||||||
foreach (explode(',', $types) as $type) {
|
foreach (explode(',', $types) as $type) {
|
||||||
foreach ($this->anchors as $anchorKey => $anchor) {
|
foreach ($this->anchors as $anchorKey => $anchor) {
|
||||||
if (strpos($anchorKey, "{$type}.{$placement}") === 0) {
|
if (strpos($anchorKey, "{$type}.{$placement}") === 0) {
|
||||||
$result .= ($type == "fw" || $type == "ether") ? "" : "{$type}-";
|
|
||||||
$prefix = $type == "ether" ? "ether " : "";
|
|
||||||
$result .= "{$prefix}anchor \"{$anchor['name']}\"";
|
|
||||||
if ($anchor['quick']) {
|
if ($anchor['quick']) {
|
||||||
$result .= " quick";
|
$result .= " quick";
|
||||||
}
|
}
|
||||||
if (!empty($anchor['ifs'])) {
|
|
||||||
$ifs = array_filter(array_map(function ($if) {
|
|
||||||
return $this->interfaceMapping[$if]['if'] ?? null;
|
|
||||||
}, explode(',', $anchor['ifs'])));
|
|
||||||
|
|
||||||
if (!empty($ifs)) {
|
|
||||||
$result .= " on {" . implode(', ', $ifs) . "}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$result .= "\n";
|
$result .= "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue