diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2009-12-24 18:50:05 +0100 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2009-12-24 18:50:05 +0100 |
commit | ffe76308243d1bafa3489a72f958f553503fd72b (patch) | |
tree | e851b335966d13f76610ef5a9cb35afd70edd216 /etc/inc/gwlb.inc | |
parent | 616e19566a37ed034f274c4738993fc1ba0954ae (diff) | |
download | pfsense-ffe76308243d1bafa3489a72f958f553503fd72b.zip pfsense-ffe76308243d1bafa3489a72f958f553503fd72b.tar.gz |
Make sure to properly use the configured monitor IP address for dynamic interfaces too.
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r-- | etc/inc/gwlb.inc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 92eaf28..fcffdc2 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -37,6 +37,10 @@ function setup_gateways_monitor() { global $config; global $g; $gateways_arr = return_gateways_array(); + if (!is_array($config['gateways']['gateway_item'])) + $config['gateways']['gateway_item'] = array(); + + $a_gateway_item = &$config['gateways']['gateway_item']; if (is_array($config['gateways']['settings'])) { $a_settings = &$config['gateways']['settings']; @@ -146,12 +150,16 @@ EOD; $i = 2; foreach($gateways_arr as $name => $gateway) { /* for dynamic gateways without an IP address we subtitute a local one */ - if($gateway['gateway'] == "dynamic") { - $gateway['monitor'] = "127.0.0.{$i}"; - $i++; - } - if($gateway['monitor'] == "") { - $gateway['monitor'] = $gateway['gateway']; + if((is_numeric($gateway['attribute'])) && ($a_gateway_item[$gateway['attribute']]['monitor'] <> "")) { + $gateway['monitor'] = $a_gateway_item[$gateway['attribute']]['monitor']; + } else { + if(($gateway['gateway'] == "dynamic") && ($gateway['monitor'])) { + $gateway['monitor'] = "127.0.0.{$i}"; + $i++; + } + if($gateway['monitor'] == "") { + $gateway['monitor'] = $gateway['gateway']; + } } $apingerconfig .= "target \"{$gateway['monitor']}\" {\n"; $apingerconfig .= " description \"{$gateway['name']}\"\n"; |