Skip to content

Commit

Permalink
load ipfw when either CP or the trafficshaper is enabled, final take on
Browse files Browse the repository at this point in the history
  • Loading branch information
AdSchellevis committed Aug 14, 2018
1 parent 32aa199 commit 82d207f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/etc/inc/system.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ function system_kernel_configure($verbose = false)
$mods[] = $config['system']['thermal_hardware'];
}

if (!empty($config['OPNsense']['TrafficShaper']['rules']['rule'])) {
if ((new \OPNsense\TrafficShaper\TrafficShaper())->isEnabled() || (new \OPNsense\CaptivePortal())->isEnabled()) {
$mods[] = "ipfw";
$mods[] = "dummynet";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,17 @@ public function getMaxRuleSequence()

return $seq;
}

/**
* retrieve last generated rule sequence number
*/
public function isEnabled()
{
foreach ($this->pipes->pipe->__items as $item) {
if ((string)$item->enabled == "1") {
return true;
}
}
return false;
}
}

0 comments on commit 82d207f

Please sign in to comment.