summaryrefslogtreecommitdiffstats
path: root/etc/inc/gwlb.inc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-11-21 09:36:50 -0200
committerRenato Botelho <garga@FreeBSD.org>2013-11-21 09:36:50 -0200
commit1ad6ad279f44676f149f3f2a35ed641b739f4dfd (patch)
treeb15903ad24b9535cb3fdcc2e4046c6658e66ac77 /etc/inc/gwlb.inc
parent186ab4ea1ae72495d52038b08ba118014b3abfab (diff)
downloadpfsense-1ad6ad279f44676f149f3f2a35ed641b739f4dfd.zip
pfsense-1ad6ad279f44676f149f3f2a35ed641b739f4dfd.tar.gz
Fix an issue that changes wrong gateway entry when items are hidden
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r--etc/inc/gwlb.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index da339ce..7984a10 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -372,10 +372,13 @@ function return_gateways_array($disabled = false, $localhost = false) {
$interfaces_v4 = array();
$interfaces_v6 = array();
- $i = 0;
+ $i = -1;
/* Process/add all the configured gateways. */
if (is_array($config['gateways']['gateway_item'])) {
foreach ($config['gateways']['gateway_item'] as $gateway) {
+ /* Increment it here to do not skip items */
+ $i++;
+
if (empty($config['interfaces'][$gateway['interface']]))
continue;
$wancfg = $config['interfaces'][$gateway['interface']];
@@ -445,7 +448,6 @@ function return_gateways_array($disabled = false, $localhost = false) {
$gateway['attribute'] = $i;
$gateways_arr[$gateway['name']] = $gateway;
- $i++;
}
}
unset($gateway);
OpenPOWER on IntegriCloud