summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgilles <gilles@openbsd.org>2010-12-19 11:24:17 +0000
committergilles <gilles@openbsd.org>2010-12-19 11:24:17 +0000
commit9d72aa2ad6d84d2eadd8879ff337acca6a21757d (patch)
tree4e3f003d0fd70cc56b47c49b4ad7387eb2c05168
parentSignificant improvements to -Thtml by kristaps@: (diff)
downloadwireguard-openbsd-9d72aa2ad6d84d2eadd8879ff337acca6a21757d.tar.xz
wireguard-openbsd-9d72aa2ad6d84d2eadd8879ff337acca6a21757d.zip
If MX lookup fails, fallback to using the host itself. This has always been
the behavior but I introduced a regression when switching to ASR. bug reported by jmc@, bugfix tested by jmc@ and I
-rw-r--r--usr.sbin/smtpd/dns.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/dns.c b/usr.sbin/smtpd/dns.c
index 7c9ca8d5cce..1599281bd1b 100644
--- a/usr.sbin/smtpd/dns.c
+++ b/usr.sbin/smtpd/dns.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dns.c,v 1.27 2010/12/12 22:29:39 jsg Exp $ */
+/* $OpenBSD: dns.c,v 1.28 2010/12/19 11:24:17 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -262,6 +262,18 @@ dns_asr_handler(int fd, short event, void *arg)
goto err;
if (h.ancount == 0) {
+ if (query->type == IMSG_DNS_MX) {
+ /* we were looking for MX and got no answer,
+ * fallback to host.
+ */
+ query->type = IMSG_DNS_HOST;
+ dnssession->aq = asr_query_host(asr, query->host,
+ AF_UNSPEC);
+ if (dnssession->aq == NULL)
+ goto err;
+ dns_asr_handler(-1, -1, dnssession);
+ return;
+ }
query->error = EAI_NONAME;
goto err;
}