ipsec: match end of key more carefully #1552

This commit is contained in:
Franco Fichtner 2017-04-21 09:12:08 +02:00
parent 2c97a083b9
commit 1dd50732ea

View File

@ -63,7 +63,7 @@ if (isset($config['ipsec']['phase1'])) {
foreach ($sas_value['child-sas'] as $child_sa_key => $child_sa_value) {
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);
$child_sa_key = preg_replace('/-[^-]+$/', '', $child_sa_key);
}
if (isset($ipsec_tunnels[$child_sa_key])) {
$ipsec_tunnels[$child_sa_key]['active'] = true;