mirror of
https://github.com/opnsense/core.git
synced 2026-06-01 00:12:10 -05:00
firewall: remove ether support from anchor registration
This commit is contained in:
@@ -220,10 +220,10 @@ class Plugin
|
||||
* @param bool $quick
|
||||
* @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));
|
||||
$this->anchors[$anchorKey] = ['name' => $name, 'quick' => $quick, 'ifs' => $ifs];
|
||||
$this->anchors[$anchorKey] = ['name' => $name, 'quick' => $quick];
|
||||
ksort($this->anchors);
|
||||
}
|
||||
|
||||
@@ -239,21 +239,9 @@ class Plugin
|
||||
foreach (explode(',', $types) as $type) {
|
||||
foreach ($this->anchors as $anchorKey => $anchor) {
|
||||
if (strpos($anchorKey, "{$type}.{$placement}") === 0) {
|
||||
$result .= ($type == "fw" || $type == "ether") ? "" : "{$type}-";
|
||||
$prefix = $type == "ether" ? "ether " : "";
|
||||
$result .= "{$prefix}anchor \"{$anchor['name']}\"";
|
||||
if ($anchor['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";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user