mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-26 16:12:05 +03:00
fix broken dns response parsing code that made most ipv6 lookups fail
This commit is contained in:
parent
e2cc0bee11
commit
d104c1f7e2
@ -257,10 +257,12 @@ int __dns_count_addrs(const unsigned char *r, int cnt)
|
|||||||
int found=0, res, i;
|
int found=0, res, i;
|
||||||
static const int p[2][2] = { { 4, RR_A }, { 16, RR_AAAA } };
|
static const int p[2][2] = { { 4, RR_A }, { 16, RR_AAAA } };
|
||||||
|
|
||||||
while (cnt--) for (i=0; i<2; i++) {
|
while (cnt--) {
|
||||||
res = __dns_get_rr(0, 0, p[i][0], -1, r, p[i][1], 0);
|
for (i=0; i<2; i++) {
|
||||||
if (res < 0) return res;
|
res = __dns_get_rr(0, 0, p[i][0], -1, r, p[i][1], 0);
|
||||||
found += res;
|
if (res < 0) return res;
|
||||||
|
found += res;
|
||||||
|
}
|
||||||
r += 512;
|
r += 512;
|
||||||
}
|
}
|
||||||
return found;
|
return found;
|
||||||
|
Loading…
Reference in New Issue
Block a user