From 8e9d1265506035ace51a8e94aa9714cca5f38734 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 14 Jan 2013 11:32:02 -0200 Subject: Check if interface really exists on interface_ppps_configure() and interface_configure() --- etc/inc/interfaces.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index ff04fa0..2030b58 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -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"); -- cgit v1.1