summaryrefslogtreecommitdiffstats
path: root/etc/inc/gwlb.inc
diff options
context:
space:
mode:
authorRenato Botelho <renato.botelho@bluepex.com>2010-10-11 12:53:20 -0300
committerRenato Botelho <renato.botelho@bluepex.com>2010-10-11 12:53:20 -0300
commit10f0a57ab4f47e73a3d248087ee54f805b4d7367 (patch)
tree84053913a36d1e294aa8730b74feeb1854129776 /etc/inc/gwlb.inc
parente857eff69bd89af17d4e39170c481efbd3c64ed3 (diff)
parentd60f510a2c4ddc298e024b5b0d1a969f710c4249 (diff)
downloadpfsense-10f0a57ab4f47e73a3d248087ee54f805b4d7367.zip
pfsense-10f0a57ab4f47e73a3d248087ee54f805b4d7367.tar.gz
Merge remote branch 'mainline/master' into inc
Conflicts: etc/inc/authgui.inc
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r--etc/inc/gwlb.inc16
1 files changed, 12 insertions, 4 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index b5d69b5..8ff94d9 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -41,6 +41,8 @@ function setup_gateways_monitor() {
if (!is_array($gateways_arr)) {
log_error("No gateways to monitor. Apinger will not be run.");
killbypid("{$g['varrun_path']}/apinger.pid");
+ // TEMPORARY XXX
+ exec("/usr/bin/killall -9 apinger");
@unlink("{$g['tmp_path']}/apinger.status");
return;
}
@@ -223,6 +225,8 @@ EOD;
fclose($fd);
killbypid("{$g['varrun_path']}/apinger.pid");
+ // TEMPORARY XXX
+ exec("/usr/bin/killall -9 apinger");
if (is_dir("{$g['tmp_path']}"))
chmod("{$g['tmp_path']}", 01777);
if (!is_dir("{$g['vardb_path']}/rrd"))
@@ -313,7 +317,10 @@ function return_gateways_array($disabled = false) {
if(! interface_has_gateway($ifname))
continue;
- $ifcfg =& $config['interfaces'][$ifname];
+ if (empty($config['interfaces'][$ifname]))
+ continue;
+
+ $ifcfg = &$config['interfaces'][$ifname];
if (!empty($ifcfg['ipaddr']) && is_ipaddr($ifcfg['ipaddr']))
continue;
@@ -325,7 +332,7 @@ function return_gateways_array($disabled = false) {
$gateway['name'] = $friendly;
$gateway['attribute'] = "system";
- if ($gateway['dynamic'] == "default") {
+ if ($gateway['dynamic'] === "default") {
$gateway['defaultgw'] = true;
$gateway['dynamic'] = true;
}
@@ -335,7 +342,8 @@ function return_gateways_array($disabled = false) {
/* automatically skip known static and dynamic gateways we have a array entry for */
foreach($gateways_arr as $gateway_item) {
- if ($ifname == $gateway_item['friendlyiface'] && $friendly == $gateway_item['name'])
+ if (($ifname == $gateway_item['friendlyiface'] && $friendly == $gateway_item['name']) ||
+ ($ifname == $gateway_item['friendlyiface'] && $gateway_item['dynamic'] == true))
continue 2;
}
@@ -497,7 +505,7 @@ function get_interface_gateway($interface, &$dynamic = false) {
$gw = NULL;
- $gwcfg =& $config['interfaces'][$interface];
+ $gwcfg = $config['interfaces'][$interface];
if (!empty($gwcfg['gateway']) && is_array($config['gateways']['gateway_item'])) {
foreach($config['gateways']['gateway_item'] as $gateway) {
if ($gateway['name'] == $gwcfg['gateway']) {
OpenPOWER on IntegriCloud