diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2021-03-17 13:53:52 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2021-03-17 13:53:52 +0000 |
commit | d62aec3ffabf77655c6bd028cf45213e034522fb (patch) | |
tree | 73f5e22595b5738b0a36e29f9819e84ac1d7a2ac /src/libs6dns/s6dns_resolvenoq_aaaaa.c | |
parent | 4a04ef3219548a450cf3b7df2cca9f009c027167 (diff) | |
download | s6-dns-d62aec3ffabf77655c6bd028cf45213e034522fb.tar.xz |
bugfix: s6dns_resolve_aaaaa API on double nodata
Diffstat (limited to 'src/libs6dns/s6dns_resolvenoq_aaaaa.c')
-rw-r--r-- | src/libs6dns/s6dns_resolvenoq_aaaaa.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libs6dns/s6dns_resolvenoq_aaaaa.c b/src/libs6dns/s6dns_resolvenoq_aaaaa.c index 7012594..378a70a 100644 --- a/src/libs6dns/s6dns_resolvenoq_aaaaa.c +++ b/src/libs6dns/s6dns_resolvenoq_aaaaa.c @@ -1,8 +1,11 @@ /* ISC license. */ +#include <errno.h> + #include <skalibs/stralloc.h> #include <skalibs/genalloc.h> #include <skalibs/ip46.h> + #include <s6-dns/s6dns-constants.h> #include <s6-dns/s6dns-domain.h> #include <s6-dns/s6dns-message.h> @@ -25,7 +28,11 @@ int s6dns_resolvenoq_aaaaa_r (genalloc *ips, char const *name, size_t len, s6dns blob[1].parsefunc = &s6dns_message_parse_answer_a ; blob[1].data = &sa[1] ; if (!s6dns_resolven_parse_r(blob, 2, servers, dbh, deadline, stamp)) return -1 ; - if (blob[0].status && blob[1].status) return (errno = blob[1].status, 0) ; + if (!sa[0].len && !sa[1].len) + { + errno = blob[1].status ? blob[1].status : blob[0].status ; + return 0 ; + } if (!genalloc_readyplus(ip46full_t, ips, (sa[0].len >> 4) + (sa[1].len >> 2))) { stralloc_free(&sa[0]) ; |