mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
IPsec, add interface when phase1 is enabled, simplify logic. (from irc)
This commit is contained in:
parent
53a5ea0ca7
commit
ac99876358
@ -159,20 +159,7 @@ function ipsec_interfaces()
|
||||
|
||||
if (isset($config['ipsec']['phase1']) && isset($config['ipsec']['phase2'])) {
|
||||
foreach ($config['ipsec']['phase1'] as $ph1ent) {
|
||||
if (!empty($ph1ent['disabled'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($config['ipsec']['phase2'] as $ph2ent) {
|
||||
if (!empty($ph2ent['disabled']) || $ph1ent['ikeid'] != $ph2ent['ikeid']) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((!empty($ph2ent['mobile']) && empty($config['ipsec']['client']['enable'])) ||
|
||||
empty($config['ipsec']['enable'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (empty($ph1ent['disabled'])) {
|
||||
$oic = array('enable' => true);
|
||||
$oic['if'] = 'enc0';
|
||||
$oic['descr'] = 'IPsec';
|
||||
@ -180,8 +167,7 @@ function ipsec_interfaces()
|
||||
$oic['virtual'] = true;
|
||||
$oic['networks'] = array();
|
||||
$interfaces['enc0'] = $oic;
|
||||
|
||||
break 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user