Commit 214385bc authored by Ad Schellevis's avatar Ad Schellevis

(system_general.php) performance issue, lookup_gateway_ip_by_name() is very...

(system_general.php) performance issue, lookup_gateway_ip_by_name() is very inefficient, don't try to execute if we know it's not a gateway.....
parent b057f997
...@@ -401,12 +401,15 @@ include("head.inc"); ...@@ -401,12 +401,15 @@ include("head.inc");
</option> </option>
<?php <?php
foreach(return_gateways_array() as $gwname => $gwitem): foreach(return_gateways_array() as $gwname => $gwitem):
if(is_ipaddrv4(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && is_ipaddrv6($gwitem['gateway'])) { if ($pconfig[$dnsgw] != "none") {
continue; if (is_ipaddrv4(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && is_ipaddrv6($gwitem['gateway'])) {
} continue;
if(is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && is_ipaddrv4($gwitem['gateway'])) { }
continue; if (is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && is_ipaddrv4($gwitem['gateway'])) {
continue;
}
}?> }?>
<option value="<?=$gwname;?>" <?=$pconfig[$dnsgw] == $gwname ? 'selected="selected"' : '' ?>> <option value="<?=$gwname;?>" <?=$pconfig[$dnsgw] == $gwname ? 'selected="selected"' : '' ?>>
<?=$gwname;?> - <?=$gwitem['friendlyiface'];?> - <?=$gwitem['gateway'];?> <?=$gwname;?> - <?=$gwitem['friendlyiface'];?> - <?=$gwitem['gateway'];?>
</option> </option>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment