summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/dns.c16
-rw-r--r--usr.sbin/smtpd/smtpd.h5
2 files changed, 8 insertions, 13 deletions
diff --git a/usr.sbin/smtpd/dns.c b/usr.sbin/smtpd/dns.c
index 36bbf407c5d..30de4495e85 100644
--- a/usr.sbin/smtpd/dns.c
+++ b/usr.sbin/smtpd/dns.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dns.c,v 1.31 2011/03/23 20:38:56 eric Exp $ */
+/* $OpenBSD: dns.c,v 1.32 2011/03/26 10:54:22 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -285,9 +285,9 @@ dns_asr_handler(int fd, short event, void *arg)
*
* -- gilles@
*/
- dnssession->mxcurrent = &dnssession->mxarray[0];
+ dnssession->mxcurrent = 0;
dnssession->aq = asr_query_host(asr,
- dnssession->mxcurrent->host, AF_UNSPEC);
+ dnssession->mxarray[dnssession->mxcurrent].host, AF_UNSPEC);
if (dnssession->aq == NULL)
goto err;
@@ -315,7 +315,6 @@ dns_asr_mx_handler(int fd, short event, void *arg)
struct smtpd *env = query->env;
struct asr_result ar;
struct timeval tv = { 0, 0 };
- struct mx *lastmx;
int ret;
switch ((ret = asr_run(dnssession->aq, &ar))) {
@@ -356,15 +355,12 @@ dns_asr_mx_handler(int fd, short event, void *arg)
goto end;
}
- lastmx = &dnssession->mxarray[dnssession->mxarraysz - 1];
- if (dnssession->mxcurrent == lastmx) {
+ if (++dnssession->mxcurrent == dnssession->mxarraysz) {
query->error = 0;
goto end;
}
-
- dnssession->mxcurrent++;
- dnssession->aq = asr_query_host(asr, dnssession->mxcurrent->host,
- AF_UNSPEC);
+ dnssession->aq = asr_query_host(asr,
+ dnssession->mxarray[dnssession->mxcurrent].host, AF_UNSPEC);
if (dnssession->aq == NULL)
goto end;
dns_asr_mx_handler(-1, -1, dnssession);
diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h
index 6b31d83727b..270a31ba01a 100644
--- a/usr.sbin/smtpd/smtpd.h
+++ b/usr.sbin/smtpd/smtpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.h,v 1.202 2011/03/15 19:24:55 gilles Exp $ */
+/* $OpenBSD: smtpd.h,v 1.203 2011/03/26 10:54:22 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -800,7 +800,6 @@ struct lkasession {
struct mx {
char host[MAXHOSTNAMELEN];
int prio;
- struct mx *next;
};
struct dnssession {
@@ -811,7 +810,7 @@ struct dnssession {
struct asr_query *aq;
struct mx mxarray[MAX_MX_COUNT];
size_t mxarraysz;
- struct mx *mxcurrent;
+ size_t mxcurrent;
};
enum mta_state {