summaryrefslogtreecommitdiffstats
path: root/etc/inc/system.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-09-30 16:04:54 +0000
committerErmal <eri@pfsense.org>2010-09-30 16:04:54 +0000
commita02708b12becb467d2d1ce4a60802e1d804d670b (patch)
treebf85cc55a9e7d9ebc06094d02edcd4a8bf335dbe /etc/inc/system.inc
parentccea4c49c2602cf0644078e8ed4eab301c8c44c4 (diff)
downloadpfsense-a02708b12becb467d2d1ce4a60802e1d804d670b.zip
pfsense-a02708b12becb467d2d1ce4a60802e1d804d670b.tar.gz
Make this code more readble and clear on what it does.
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r--etc/inc/system.inc13
1 files changed, 6 insertions, 7 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 10f785c..e728910 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -372,16 +372,15 @@ function system_routing_configure($interface = "") {
foreach ($config['staticroutes']['route'] as $rtent) {
$gatewayip = "";
- if (isset($gateways_arr[$rtent['gateway']])) {
- if ($interface == $gateways_arr[$rtent['gateway']]['friendlyiface'])
- continue;
- $gatewayip = $gateways_arr[$rtent['gateway']]['gateway'];
- $interfacegw = $gateways_arr[$rtent['gateway']]['interface'];
- } else {
+ if (empty($gateways_arr[$rtent['gateway']])) {
log_error("Static Routes: Gateway IP could not be found for {$rtent['network']}");
continue;
}
-
+ $gateway = $gateways_arr[$rtent['gateway']];
+ if ($interface == $gateway['friendlyiface'])
+ continue;
+ $gatewayip = $gateway['gateway'];
+ $interfacegw = $gateway['interface'];
$action = "add";
if (isset($route_arr[$rtent['network']]))
$action = "change";
OpenPOWER on IntegriCloud