summaryrefslogtreecommitdiffstats
path: root/usr/local/www/wizards
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-07-24 18:20:09 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-07-24 18:28:01 -0300
commite75a787fcae4f94de0aa379d762c86d77835ffb0 (patch)
tree30c4a98e10b07b21d3a0a08ce340c074e750be59 /usr/local/www/wizards
parent46cbc96e0943cad0c39b1ca26a5ec818352f7692 (diff)
downloadpfsense-e75a787fcae4f94de0aa379d762c86d77835ffb0.zip
pfsense-e75a787fcae4f94de0aa379d762c86d77835ffb0.tar.gz
Fix number of WAN / LAN interfaces detection for dedicated wizard
Diffstat (limited to 'usr/local/www/wizards')
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc15
1 files changed, 11 insertions, 4 deletions
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
index edf046a..8ca9b9f 100644
--- a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
@@ -36,6 +36,7 @@ function step1_stepbeforeformdisplay() {
$fields =& $pkg['step'][0]['fields']['field'];
$wans = 0;
+ $lans = 0;
$iflisttmp = get_configured_interface_with_descr();
foreach ($iflisttmp as $if => $ifdesc) {
@@ -43,11 +44,13 @@ function step1_stepbeforeformdisplay() {
continue;
if (interface_has_gateway($if) || interface_has_gatewayv6($if))
$wans++;
+ else
+ $lans++;
}
foreach ($fields as &$field)
if ($field['name'] == 'numberofconnections')
- $field['value'] = $wans;
+ $field['value'] = ($wans < $lans ? $wans : $lans);
}
function step1_submitphpaction() {
@@ -69,17 +72,21 @@ function step2_stepbeforeformdisplay() {
global $config, $pkg;
global $stepid, $savemsg;
- $numberofinterfaces = 0;
+ $wans = 0;
+ $lans = 0;
$iflist = array();
$iflisttmp = get_configured_interface_with_descr();
foreach ($iflisttmp as $if => $ifdesc) {
if (!is_altq_capable(get_real_interface($if)))
continue;
- $numberofinterfaces++;
+ if (interface_has_gateway($if) || interface_has_gatewayv6($if))
+ $wans++;
+ else
+ $lans++;
$iflist[$if] = $ifdesc;
}
$numberofconnections = intval($config['ezshaper']['step1']['numberofconnections']);
- if ($numberofconnections > ($numberofinterfaces/2)) {
+ if ($numberofconnections > ($wans < $lans ? $wans : $lans)) {
$savemsg=gettext("You have less interfaces than number of connections!");
$stepid--;
return;
OpenPOWER on IntegriCloud