[Web] Expand IPv6 addresses for better comparison
This commit is contained in:
@@ -94,7 +94,7 @@ if ($_SESSION['mailcow_cc_role'] == "admin") {
|
||||
$records[] = array(
|
||||
$mailcow_hostname,
|
||||
'AAAA',
|
||||
$ip6
|
||||
expand_ipv6($ip6)
|
||||
);
|
||||
$records[] = array(
|
||||
$ptr6,
|
||||
@@ -335,6 +335,11 @@ foreach ($records as $record) {
|
||||
}
|
||||
unset($current);
|
||||
}
|
||||
elseif ($record[1] == 'AAAA') {
|
||||
foreach ($currents as &$current) {
|
||||
$current['ipv6'] = expand_ipv6($current['ipv6']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($record[1] == 'CNAME' && count($currents) == 0) {
|
||||
@@ -346,8 +351,8 @@ foreach ($records as $record) {
|
||||
$currents = array(array('host' => $record[0], 'class' => 'IN', 'type' => 'CNAME', 'target' => $record[2]));
|
||||
$aaaa = dns_get_record($record[0], DNS_AAAA);
|
||||
$cname = dns_get_record($record[2], DNS_AAAA);
|
||||
if (count($aaaa) == 0 || count($cname) == 0 || $aaaa[0]['ipv6'] != $cname[0]['ipv6']) {
|
||||
$currents[0]['target'] = $aaaa[0]['ipv6'] . ' <sup>1</sup>';
|
||||
if (count($aaaa) == 0 || count($cname) == 0 || expand_ipv6($aaaa[0]['ipv6']) != expand_ipv6($cname[0]['ipv6'])) {
|
||||
$currents[0]['target'] = expand_ipv6($aaaa[0]['ipv6']) . ' <sup>1</sup>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user