This commit is contained in:
Ad Schellevis 2018-04-22 18:45:37 +02:00
parent 80758e642e
commit d482a93ecd
2 changed files with 0 additions and 33 deletions

View File

@ -578,19 +578,6 @@ function ipsec_find_id(&$ph1ent, $side = 'local')
case "myaddress":
$thisid_data = ipsec_get_phase1_src($ph1ent);
break;
case "dyn_dns":
$thisid_data = resolve_retry($id_data);
break;
case "peeraddress":
if (!is_ipaddr($ph1ent['remote-gateway'])) {
$thisid_data = resolve_retry($ph1ent['remote-gateway']);
} else {
$thisid_data = $ph1ent['remote-gateway'];
}
break;
case "address":
$thisid_data = $id_data;
break;
default:
$thisid_data = !empty($id_data) ? "{$id_data}" : null;
break;

View File

@ -1089,26 +1089,6 @@ function is_private_ip($iptocheck)
return false;
}
function resolve_retry($hostname, $retries = 5)
{
if (is_ipaddr($hostname)) {
return $hostname;
}
for ($i = 0; $i < $retries; $i++) {
// FIXME: gethostbyname does not work for AAAA hostnames, boo, hiss
$ip = gethostbyname($hostname);
if ($ip && $ip != $hostname) {
/* success */
return $ip;
}
sleep(1);
}
return false;
}
function format_bytes($bytes)
{
if ($bytes >= (1024 * 1024 * 1024)) {