diff options
Diffstat (limited to 'etc/inc/ipsec.inc')
-rw-r--r-- | etc/inc/ipsec.inc | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/etc/inc/ipsec.inc b/etc/inc/ipsec.inc index 6e3e346..fe45912 100644 --- a/etc/inc/ipsec.inc +++ b/etc/inc/ipsec.inc @@ -653,41 +653,41 @@ function ipsec_find_id(& $ph1ent, $side = "local", $rgmap = array()) { $addr = "%any"; else $addr = $ph1ent['remote-gateway']; - } else { + } else return array(); - } $thisid_type = $id_type; switch ($thisid_type) { - case "myaddress": - $thisid_type = "address"; + case 'myaddress': + $thisid_type = 'address'; $thisid_data = $addr; break; - - case "dyn_dns": - $thisid_type = "address"; - $thisid_data = resolve_retry($id_data); + case 'dyn_dns': + $thisid_type = 'dns'; + $thisid_data = $id_data; break; - - case "peeraddress": - $thisid_type = "address"; + case 'peeraddress': + $thisid_type = 'address'; $thisid_data = $rgmap[$ph1ent['remote-gateway']]; break; - - case "address"; + case 'address'; $thisid_data = $id_data; break; - - case "fqdn"; - case "keyid tag"; - case "user_fqdn"; - $thisid_data = $id_data; + case 'fqdn'; + $thisid_data = "{$id_data}"; + break; + case 'keyid tag'; + $thisid_type = 'keyid'; + $thisid_data = "{$thisid_data}"; + break; + case 'user_fqdn'; + $thisid_type = 'userfqdn'; + $thisid_data = "{$id_data}"; break; - case "asn1dn"; + case 'asn1dn'; $thisid_data = $id_data; - if( $thisid_data && $thisid_data[0] != '"') - $thisid_data = "\"{$thisid_data}\""; + $thisid_data = "{$id_data}"; break; } return array($thisid_type, $thisid_data); |