diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2019-08-23 15:39:12 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2019-08-23 15:39:12 +0000 |
commit | ef2a14cc385312095f978052bfb0123e04304b44 (patch) | |
tree | 87c968f569fd681bc1df3842d76993c5597cb35a /usr.sbin | |
parent | a11bb3c8d564f4828a5a235e05dab86e3e15c811 (diff) |
only process records of the expected type.
fix an issue where CNAME records generate bogus results.
ok gilles@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/spfwalk.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/usr.sbin/smtpd/spfwalk.c b/usr.sbin/smtpd/spfwalk.c index 22b057963f9..40d4888d564 100644 --- a/usr.sbin/smtpd/spfwalk.c +++ b/usr.sbin/smtpd/spfwalk.c @@ -229,6 +229,9 @@ dispatch_mx(struct dns_rr *rr) { char buf[512]; + if (rr->rr_type != T_MX) + return; + print_dname(rr->rr.mx.exchange, buf, sizeof(buf)); buf[strlen(buf) - 1] = '\0'; if (buf[strlen(buf) - 1] == '.') @@ -243,6 +246,9 @@ dispatch_a(struct dns_rr *rr) char buffer[512]; const char *ptr; + if (rr->rr_type != T_A) + return; + if ((ptr = inet_ntop(AF_INET, &rr->rr.in_a.addr, buffer, sizeof buffer))) printf("%s\n", ptr); @@ -254,6 +260,9 @@ dispatch_aaaa(struct dns_rr *rr) char buffer[512]; const char *ptr; + if (rr->rr_type != T_AAAA) + return; + if ((ptr = inet_ntop(AF_INET6, &rr->rr.in_aaaa.addr6, buffer, sizeof buffer))) printf("%s\n", ptr); |