From 4b176ed234e1439f607e363f9bf3296f2858d3bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=C3=A7i?= Date: Tue, 9 Sep 2008 22:25:54 +0000 Subject: Do not execute the command if interface is not configured at all(type = none). --- etc/inc/interfaces.inc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'etc') diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 6ad3f7b..29ad37a 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1095,13 +1095,16 @@ function interface_configure($interface = "wan") { break; default: - if (isset($wancfg['ispointtopoint']) && $wancfg['pointtopoint']) { + if ($wancfg['ipaddr'] <> "" && $wancfg['subnet'] <> "") { + if (isset($wancfg['ispointtopoint']) && $wancfg['pointtopoint']) { mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " " . escapeshellarg($wancfg['ipaddr'] . "/" . $wancfg['subnet']) . " " . escapeshellarg($wancfg['pointtopoint']) . " up"); - } else { - mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " " . - escapeshellarg($wancfg['ipaddr'] . "/" . $wancfg['subnet'])); + } else { + mwexec("/sbin/ifconfig " . escapeshellarg($realif) . + " " . escapeshellarg($wancfg['ipaddr'] . "/" . + $wancfg['subnet'])); + } } if (is_ipaddr($wancfg['gateway'])) -- cgit v1.1