validate result of Net_DNS2_Resolver::query (CNAME's are being resolved to their corresponding target A/AAAA addresses); fixes #1089
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -263,7 +263,9 @@ class PhpHelper
|
|||||||
try {
|
try {
|
||||||
$answer = $resolver->query($host, 'A')->answer;
|
$answer = $resolver->query($host, 'A')->answer;
|
||||||
foreach ($answer as $rr) {
|
foreach ($answer as $rr) {
|
||||||
$ips[] = inet_ntop(inet_pton($rr->address));
|
if ($rr instanceof Net_DNS2_RR_A) {
|
||||||
|
$ips[] = inet_ntop(inet_pton($rr->address));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Net_DNS2_Exception $e) {
|
} catch (Net_DNS2_Exception $e) {
|
||||||
// we can't do anything here, just continue
|
// we can't do anything here, just continue
|
||||||
@@ -274,7 +276,9 @@ class PhpHelper
|
|||||||
try {
|
try {
|
||||||
$answer = $resolver->query($host, 'AAAA')->answer;
|
$answer = $resolver->query($host, 'AAAA')->answer;
|
||||||
foreach ($answer as $rr) {
|
foreach ($answer as $rr) {
|
||||||
$ips[] = inet_ntop(inet_pton($rr->address));
|
if ($rr instanceof Net_DNS2_RR_AAAA) {
|
||||||
|
$ips[] = inet_ntop(inet_pton($rr->address));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Net_DNS2_Exception $e) {
|
} catch (Net_DNS2_Exception $e) {
|
||||||
// we can't do anything here, just continue
|
// we can't do anything here, just continue
|
||||||
|
|||||||
Reference in New Issue
Block a user