summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/pfsense-utils.inc10
-rw-r--r--etc/inc/system.inc22
2 files changed, 19 insertions, 13 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index a6a3d1f..5ecdf49 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -3380,10 +3380,12 @@ function get_interface_gateway($interface) {
$gw = file_get_contents("{$g['tmp_path']}/{$realif}_router");
$gw = rtrim($gw);
} else {
- foreach($config['gateways']['gateway_item'] as $gateway) {
- if($gateway['name'] == $gateway['name']) {
- $gatewayip = $gateway['gateway'];
- $interfacegw = $gateway['interface'];
+ if(is_array($config['gateways'])) {
+ foreach($config['gateways']['gateway_item'] as $gateway) {
+ if($gateway['name'] == $gateway['name']) {
+ $gatewayip = $gateway['gateway'];
+ $interfacegw = $gateway['interface'];
+ }
}
}
$gw = $gatewayip;
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index c055874..d58f9e6 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -282,10 +282,12 @@ function system_routing_configure() {
}
if($dont_add_route == false) {
- foreach($config['gateways']['gateway_item'] as $gateway) {
- if(isset($gateway['defaultgw'])) {
- $gatewayip = $gateway['gateway'];
- $interfacegw = $gateway['interface'];
+ if(is_array($config['gateways'])) {
+ foreach($config['gateways']['gateway_item'] as $gateway) {
+ if(isset($gateway['defaultgw'])) {
+ $gatewayip = $gateway['gateway'];
+ $interfacegw = $gateway['interface'];
+ }
}
}
mwexec("/sbin/route add default " . escapeshellarg($gatewayip));
@@ -300,10 +302,12 @@ function system_routing_configure() {
}
foreach ($config['staticroutes']['route'] as $rtent) {
- foreach($config['gateways']['gateway_item'] as $gateway) {
- if($rtent['gateway'] == $gateway['name']) {
- $gatewayip = $gateway['gateway'];
- $interfacegw = $gateway['interface'];
+ if(is_array($config['gateways'])) {
+ foreach($config['gateways']['gateway_item'] as $gateway) {
+ if($rtent['gateway'] == $gateway['name']) {
+ $gatewayip = $gateway['gateway'];
+ $interfacegw = $gateway['interface'];
+ }
}
}
if(isset($rtent['interfacegateway'])) {
@@ -1295,4 +1299,4 @@ function enable_watchdog() {
}
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud