Do not log useless log and do the check earlier as a microoptimization.

This commit is contained in:
Ermal 2010-06-10 12:27:03 +00:00
parent 8a4778d31a
commit 0bca02ca58

View File

@ -998,6 +998,8 @@ function interface_ppps_configure($interface) {
mwexec("/bin/ln -s /usr/local/sbin/mpd.script {$g['varetc_path']}/.");
$ifcfg = &$config['interfaces'][$interface];
if (!isset($ifcfg['enable']))
return 0;
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
if ($ifcfg['if'] == $ppp['if'])
@ -1008,10 +1010,6 @@ function interface_ppps_configure($interface) {
log_error("Can't find PPP config for {$ifcfg['if']} in interface_ppps_configure().");
return 0;
}
if (!isset($ifcfg['enable'])) {
log_error("{$interface} is not enabled.");
return 0;
}
$pppif = $ifcfg['if'];
if ($ppp['type'] == "ppp")
$type = "modem";