mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
custom scrub rules need to be first
The custom scrub rules on the normalization settings page effectively cannot be reached since the standard interface scrub rules are listed first. This patch swaps that order around so that custom scrub rules get evaluated first.
This commit is contained in:
parent
c17a834f0f
commit
23ea5bcfba
@ -570,26 +570,7 @@ function filter_generate_scrubing(&$FilterIflist)
|
||||
|
||||
$scrubrules = '';
|
||||
|
||||
/* scrub per interface options */
|
||||
if (empty($config['system']['scrub_interface_disable'])) {
|
||||
foreach ($FilterIflist as $scrubif => $scrubcfg) {
|
||||
if (isset($scrubcfg['virtual']) || empty($scrubcfg['descr'])) {
|
||||
continue;
|
||||
} else {
|
||||
/* set up MSS clamping */
|
||||
if (!empty($scrubcfg['mss']) && is_numeric($scrubcfg['mss']) &&
|
||||
!in_array($scrubcfg['if'], array('pppoe', 'pptp', 'l2tp'))) {
|
||||
$mssclamp = "max-mss " . (intval($scrubcfg['mss'] - 40));
|
||||
} else {
|
||||
$mssclamp = '';
|
||||
}
|
||||
$scrubnodf = !empty($config['system']['scrubnodf']) ? "no-df" : "";
|
||||
$scrubrnid = !empty($config['system']['scrubrnid']) ? "random-id" : "";
|
||||
$scrubrules .= "scrub on \${$scrubcfg['descr']} all {$scrubnodf} {$scrubrnid} {$mssclamp}\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* custom rules must be first */
|
||||
if (!empty($config['filter']['scrub']['rule'])) {
|
||||
foreach ($config['filter']['scrub']['rule'] as $scrub_rule) {
|
||||
if (!isset($scrub_rule['disabled'])) {
|
||||
@ -634,6 +615,26 @@ function filter_generate_scrubing(&$FilterIflist)
|
||||
}
|
||||
}
|
||||
|
||||
/* scrub per interface options */
|
||||
if (empty($config['system']['scrub_interface_disable'])) {
|
||||
foreach ($FilterIflist as $scrubif => $scrubcfg) {
|
||||
if (isset($scrubcfg['virtual']) || empty($scrubcfg['descr'])) {
|
||||
continue;
|
||||
} else {
|
||||
/* set up MSS clamping */
|
||||
if (!empty($scrubcfg['mss']) && is_numeric($scrubcfg['mss']) &&
|
||||
!in_array($scrubcfg['if'], array('pppoe', 'pptp', 'l2tp'))) {
|
||||
$mssclamp = "max-mss " . (intval($scrubcfg['mss'] - 40));
|
||||
} else {
|
||||
$mssclamp = '';
|
||||
}
|
||||
$scrubnodf = !empty($config['system']['scrubnodf']) ? "no-df" : "";
|
||||
$scrubrnid = !empty($config['system']['scrubrnid']) ? "random-id" : "";
|
||||
$scrubrules .= "scrub on \${$scrubcfg['descr']} all {$scrubnodf} {$scrubrnid} {$mssclamp}\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $scrubrules;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user