IPsec: simplify previous with legacy_interface_create()

This commit is contained in:
Ad Schellevis 2020-08-07 19:57:23 +02:00
parent 9167000171
commit 58b672fcab

View File

@ -1899,9 +1899,7 @@ function ipsec_configure_vti($verbose = false)
$inet = is_ipaddrv6($intf_details['local']) ? 'inet6' : 'inet';
if (empty($current_interfaces[$intf])) {
// prevent ipsec vti interface to hit 32768 limit (create numbered, rename and attach afterwards)
exec('/sbin/ifconfig ipsec create 2>&1', $cmdout, $cmdret);
if ($cmdret == 0) {
legacy_interface_rename($cmdout[0], $intf);
if (legacy_interface_create("ipsec", $intf) != null) {
mwexecf('/sbin/ifconfig %s reqid %s', array($intf, $intf_details['reqid']));
mwexecf(
'/sbin/ifconfig %s %s tunnel %s %s up',