summaryrefslogtreecommitdiff
path: root/src/dnsstub/dns_mx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dnsstub/dns_mx.c')
-rw-r--r--src/dnsstub/dns_mx.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/dnsstub/dns_mx.c b/src/dnsstub/dns_mx.c
index 3a140d2..967999e 100644
--- a/src/dnsstub/dns_mx.c
+++ b/src/dnsstub/dns_mx.c
@@ -4,11 +4,11 @@
#include "uint_t.h"
/**
- @file dns_mx.c
- @author djb
- @source qmail
- @brief dns MX query
- @param (on output) stralloc out
+ @file dns_mx.c
+ @author djb
+ @source qmail
+ @brief dns MX query
+ @param (on output) stralloc out
*/
static char *q = 0;
@@ -37,7 +37,7 @@ int dns_mx_packet(stralloc *out, const char *buf, unsigned int len)
pos = dns_packet_copy(buf, len, pos, header, 10);
if (!pos) return DNS_ERR;
uint16_unpack_big(header + 8, &datalen);
- if (byte_equal(header, 2, DNS_T_MX))
+ if (byte_equal(header, 2, DNS_T_MX)) {
if (byte_equal(header + 2, 2, DNS_C_IN)) {
if (!dns_packet_copy(buf, len, pos, pref, 2)) return DNS_ERR;
if (!dns_packet_getname(buf, len, pos + 2, &q)) return DNS_ERR;
@@ -45,6 +45,7 @@ int dns_mx_packet(stralloc *out, const char *buf, unsigned int len)
if (dns_domain_todot_cat(out, q) <= 0) return DNS_ERR;
if (!stralloc_0(out)) return DNS_MEM;
}
+ }
pos += datalen;
++ranswers;
}