summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-01-31 11:16:16 +0000
committerErmal <eri@pfsense.org>2013-01-31 11:16:16 +0000
commit12aea7f16db989a1c12f904cdd60049bd39690c8 (patch)
tree1379ce421c445a561b3f43742cd486caf300171b
parent7a04cd20c4d5991c5afeb431589c75aa3956b654 (diff)
downloadpfsense-12aea7f16db989a1c12f904cdd60049bd39690c8.zip
pfsense-12aea7f16db989a1c12f904cdd60049bd39690c8.tar.gz
Do not do any operation if its not necessary
-rw-r--r--etc/inc/interfaces.inc13
1 files changed, 8 insertions, 5 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 107f9bf..6134b41 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -3157,9 +3157,11 @@ function interface_6rd_configure($interface = "wan", $wancfg) {
$rd6prefix = convert_128bit_to_ipv6($rd6prefixbin);
/* XXX: need to extend to support variable prefix size for v4 */
- $tmpstfiface = pfSense_interface_create("stf");
$stfiface = "{$interface}_stf";
- pfSense_interface_rename($tmpstfiface, $stfiface);
+ if (!does_interface_exist($stfiface)) {
+ $tmpstfiface = pfSense_interface_create("stf");
+ pfSense_interface_rename($tmpstfiface, $stfiface);
+ }
pfSense_interface_flags($stfiface, IFF_LINK2);
mwexec("/sbin/ifconfig {$stfiface} inet6 {$rd6prefix}/{$rd6prefixlen}");
if ($g['debug'])
@@ -3250,9 +3252,10 @@ function interface_6to4_configure($interface = "wan", $wancfg){
/* setup the stf interface */
$stfiface = "{$interface}_stf";
- pfSense_interface_destroy($stfiface);
- $tmpstfiface = pfSense_interface_create("stf");
- pfSense_interface_rename($tmpstfiface, $stfiface);
+ if (!does_interface_exist($stfiface)) {
+ $tmpstfiface = pfSense_interface_create("stf");
+ pfSense_interface_rename($tmpstfiface, $stfiface);
+ }
pfSense_interface_flags($stfiface, IFF_LINK2);
mwexec("/sbin/ifconfig {$stfiface} inet6 {$stflanpr} prefixlen 16");
OpenPOWER on IntegriCloud