ipsec: work around widget issues; closes #1552

In the end, it's better to check if the key exists, although it
always should, that's what the key is for....
This commit is contained in:
Franco Fichtner 2017-04-20 22:46:28 +02:00
parent 27791f7a3d
commit a60db3cede

View File

@ -61,8 +61,14 @@ if (isset($config['ipsec']['phase1'])) {
}
foreach ($status_value['sas'] as $sas_key => $sas_value) {
foreach ($sas_value['child-sas'] as $child_sa_key => $child_sa_value) {
$ipsec_tunnels[$child_sa_key]['active'] = true;
$activetunnels++;
if (!isset($ipsec_tunnels[$child_sa_key])) {
/* XXX bug on strongSwan 5.5.2 appends -3 and -4 here? */
$child_sa_key = preg_replace('/-.*$/', '', $child_sa_key);
}
if (isset($ipsec_tunnels[$child_sa_key])) {
$ipsec_tunnels[$child_sa_key]['active'] = true;
$activetunnels++;
}
}
}
}