From 630cfa6ce6befc10623cfb3001757da5db26e02f Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 19 Nov 2008 05:29:28 +0000 Subject: * Do not destory enc0 * Only run ifconfig if a real ip and netmask exists instead of ifconfig --- etc/inc/interfaces.inc | 9 +++++---- etc/inc/vpn.inc | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'etc') diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 7abc3d3..11fe309 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1327,9 +1327,10 @@ function interface_configure($interface = "wan") escapeshellarg($wancfg['ipaddr'] . "/" . $wancfg['subnet']) . " " . escapeshellarg($wancfg['pointtopoint']) . " up"); } else { - mwexec("/sbin/ifconfig " . escapeshellarg($realif) . - " " . escapeshellarg($wancfg['ipaddr'] . "/" . - $wancfg['subnet'])); + if($wancfg['ipaddr'] && $wancfg['subnet']) + mwexec("/sbin/ifconfig " . escapeshellarg($realif) . + " " . escapeshellarg($wancfg['ipaddr'] . "/" . + $wancfg['subnet'])); } } @@ -1952,4 +1953,4 @@ function get_interface_mac($interface) return $mac; } -?> +?> \ No newline at end of file diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index 67de51e..50e935a 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -134,7 +134,6 @@ function vpn_ipsec_configure($ipchg = false) if (!isset($ipseccfg['enable'])) { mwexec("/sbin/ifconfig enc0 down"); - mwexec("/sbin/ifconfig enc0 destroy"); /* kill racoon */ mwexec("/usr/bin/killall racoon", true); @@ -1478,4 +1477,5 @@ EOD; return 0; } -?> + +?> \ No newline at end of file -- cgit v1.1