IPSec: Just destroy interface if it exists and it's not booting

Based on PR: https://github.com/pfsense/pfsense/pull/4076
This commit is contained in:
Renato Botelho do Couto 2019-09-03 15:43:16 -03:00
parent 03cdd6ad04
commit f8c4bfc52a

View File

@ -1427,12 +1427,10 @@ function interface_ipsec_vti_configure($ph1ent) {
continue;
}
// Create IPsec interface
if (platform_booting() || !does_interface_exist($ipsecif)) {
if (!platform_booting() && does_interface_exist($ipsecif)) {
mwexec("/sbin/ifconfig " . escapeshellarg($ipsecif) . " destroy", false);
mwexec("/sbin/ifconfig " . escapeshellarg($ipsecif) . " create reqid " . escapeshellarg($ipsecifnum), false);
} else {
mwexec("/sbin/ifconfig " . escapeshellarg($ipsecif) . " create reqid " . escapeshellarg($ipsecifnum), false);
}
mwexec("/sbin/ifconfig " . escapeshellarg($ipsecif) . " create reqid " . escapeshellarg($ipsecifnum), false);
/* Apply the outer tunnel addresses to the interface */
$inet = is_ipaddrv6($left_spec) ? "inet6" : "inet";