summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--getservinfo.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/getservinfo.c b/getservinfo.c
index 7565ef1..04685d7 100644
--- a/getservinfo.c
+++ b/getservinfo.c
@@ -100,14 +100,12 @@ int getservinfo(
 
 	uint8_t *ptr = msg;
 	u16(&ptr); // ID
-	uint16_t rcode = u16(&ptr) & 0x000F;
+	u16(&ptr); // QR, OPCODE, AA, TC, RD, RA, Z, RCODE
 	uint16_t qdcount = u16(&ptr);
-	uint16_t ancount = u16(&ptr);
+	u16(&ptr); // ANCOUNT
 	u16(&ptr); // NSCOUNT
 	u16(&ptr); // ARCOUNT
 
-	if (rcode || !ancount) return getaddrinfo(hostname, servname, hints, res);
-
 	for (uint16_t q = 0; q < qdcount; ++q) {
 		nameSkip(&ptr); // QNAME
 		u16(&ptr); // QTYPE