OSDN Git Service
(root)
/
android-x86
/
external-musl-libc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e2cc0be
)
fix broken dns response parsing code that made most ipv6 lookups fail
author
Rich Felker
<dalias@aerifal.cx>
Fri, 8 Apr 2011 12:49:28 +0000
(08:49 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 8 Apr 2011 12:49:28 +0000
(08:49 -0400)
src/network/__dns.c
patch
|
blob
|
history
diff --git
a/src/network/__dns.c
b/src/network/__dns.c
index
cdd6429
..
b53ad4a
100644
(file)
--- a/
src/network/__dns.c
+++ b/
src/network/__dns.c
@@
-257,10
+257,12
@@
int __dns_count_addrs(const unsigned char *r, int cnt)
int found=0, res, i;
static const int p[2][2] = { { 4, RR_A }, { 16, RR_AAAA } };
- while (cnt--) for (i=0; i<2; i++) {
- res = __dns_get_rr(0, 0, p[i][0], -1, r, p[i][1], 0);
- if (res < 0) return res;
- found += res;
+ while (cnt--) {
+ for (i=0; i<2; i++) {
+ res = __dns_get_rr(0, 0, p[i][0], -1, r, p[i][1], 0);
+ if (res < 0) return res;
+ found += res;
+ }
r += 512;
}
return found;