Check if interface really exists on interface_ppps_configure() and interface_configure()

This commit is contained in:
Renato Botelho 2013-01-14 11:32:02 -02:00
parent 11d1d64e81
commit 8e9d126550

View File

@ -1351,8 +1351,11 @@ function interface_ppps_configure($interface) {
$ports = explode(',',$ppp['ports']);
if ($type != "modem") {
foreach ($ports as $pid => $port)
foreach ($ports as $pid => $port) {
$ports[$pid] = get_real_interface($port);
if (empty($ports[$pid]))
return 0;
}
}
$localips = explode(',',$ppp['localip']);
$gateways = explode(',',$ppp['gateway']);
@ -2630,6 +2633,9 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven
// Need code to handle MLPPP if we ever use $realhwif for MLPPP handling
$realhwif = $realhwif_array[0];
if (!does_interface_exist($realhwif))
return 0;
/* Disable Accepting router advertisements unless specifically requested */
log_error("Deny router advertisements for interface {$interface}");
mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 -accept_rtadv");