diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-11-21 09:36:50 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-11-21 09:37:02 -0200 |
commit | 23d9f68660373adc3b419af857001aa992978d17 (patch) | |
tree | 0d0d022184bcda19c3d318f7e615c0477cd2498d /etc/inc | |
parent | 33e71f1087e1885eae9393626a331147eca5c7c7 (diff) | |
download | pfsense-23d9f68660373adc3b419af857001aa992978d17.zip pfsense-23d9f68660373adc3b419af857001aa992978d17.tar.gz |
Fix an issue that changes wrong gateway entry when items are hidden
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/gwlb.inc | 6 |
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); |