diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-11-26 18:40:41 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-11-26 18:40:41 -0200 |
commit | 06b8d43c3fb34bd8773d9d99c9a35410c63efa75 (patch) | |
tree | 0a4b1d8c811ef4c84c76dd14af12a1c3ba5b09ff /etc/inc/gwlb.inc | |
parent | a5249874001fa4ce91704ee1cc1891c0eb246025 (diff) | |
download | pfsense-06b8d43c3fb34bd8773d9d99c9a35410c63efa75.zip pfsense-06b8d43c3fb34bd8773d9d99c9a35410c63efa75.tar.gz |
Add a new param to return_gateways_array and make it return gateways when interface doesn't exist. Default behavior didn't change. Also check the new gateway parameter (disabled) when filtering
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r-- | etc/inc/gwlb.inc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 7984a10..bc5709e 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -359,7 +359,7 @@ function return_gateways_status($byname = false) { } /* Return all configured gateways on the system */ -function return_gateways_array($disabled = false, $localhost = false) { +function return_gateways_array($disabled = false, $localhost = false, $inactive = false) { global $config, $g; $gateways_arr = array(); @@ -379,12 +379,16 @@ function return_gateways_array($disabled = false, $localhost = false) { /* Increment it here to do not skip items */ $i++; - if (empty($config['interfaces'][$gateway['interface']])) - continue; + if (empty($config['interfaces'][$gateway['interface']])) { + if ($inactive === false) + continue; + else + $gateway['inactive'] = true; + } $wancfg = $config['interfaces'][$gateway['interface']]; /* skip disabled interfaces */ - if ($disabled === false && !isset($wancfg['enable'])) + if ($disabled === false && (!isset($wancfg['enable']) || !isset($gateway['disabled']))) continue; /* if the gateway is dynamic and we can find the IPv4, Great! */ |