dirmngr: Fix SRV record lookups when using the system resolver.

* dirmngr/dns-stuff.c (getsrv): Fix error handling.
--
This fixes hkp server pools not using SRV records.

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2015-11-23 15:46:33 +01:00
parent 73c1a86ad9
commit 946faaff04
1 changed files with 2 additions and 2 deletions

View File

@ -1086,10 +1086,10 @@ getsrv (const char *name,struct srventry **list)
return -1;
r = res_query (name, C_IN, T_SRV, answer, sizeof answer);
if (r < sizeof (HEADER) || r > sizeof answer)
return -1;
if (header->rcode != NOERROR || !(count=ntohs (header->ancount)))
return 0; /* Error or no record found. */
if (r < sizeof (HEADER) || r > sizeof answer)
return -1;
emsg = &answer[r];
pt = &answer[sizeof(HEADER)];