summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2011-11-28 22:13:28 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2011-11-28 22:13:28 +0000
commit791fa9e812bffdd1d18a422a95f1a38d088de2a0 (patch)
treec563cf0477adf6b70ca886381319a7616b986f80 /usr.sbin/smtpd
parent12153d2c7b20ffb704a75582c22d13633e38b361 (diff)
use STATUS_* filter codes, instead of -1/0/1 hard coded values
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/filter.c6
-rw-r--r--usr.sbin/smtpd/filter.h3
-rw-r--r--usr.sbin/smtpd/mfa_session.c6
3 files changed, 7 insertions, 8 deletions
diff --git a/usr.sbin/smtpd/filter.c b/usr.sbin/smtpd/filter.c
index 39c4e634c84..d9ac54b92d8 100644
--- a/usr.sbin/smtpd/filter.c
+++ b/usr.sbin/smtpd/filter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: filter.c,v 1.4 2011/11/16 10:24:41 chl Exp $ */
+/* $OpenBSD: filter.c,v 1.5 2011/11/28 22:13:27 chl Exp $ */
/*
* Copyright (c) 2011 Gilles Chehade <gilles@openbsd.org>
@@ -215,8 +215,6 @@ filter_handler(int fd, short event, void *p)
case STATUS_ACCEPT:
case STATUS_REJECT:
fm.code = ret;
- if (ret == STATUS_REJECT)
- fm.code = -1;
imsg_compose(&fi.ibuf, imsg.hdr.type, 0, 0, -1, &fm,
sizeof fm);
evflags |= EV_WRITE;
@@ -235,7 +233,7 @@ filter_handler(int fd, short event, void *p)
ignore:
imsg_free(&imsg);
- fm.code = 0;
+ fm.code = STATUS_IGNORE;
imsg_compose(&fi.ibuf, imsg.hdr.type, 0, 0, -1, &fm, sizeof fm);
evflags |= EV_WRITE;
event_set(&fi.ev, 0, evflags, filter_handler, &fi);
diff --git a/usr.sbin/smtpd/filter.h b/usr.sbin/smtpd/filter.h
index 6c33e4654a1..5ccd66b4194 100644
--- a/usr.sbin/smtpd/filter.h
+++ b/usr.sbin/smtpd/filter.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: filter.h,v 1.5 2011/11/16 10:24:41 chl Exp $ */
+/* $OpenBSD: filter.h,v 1.6 2011/11/28 22:13:27 chl Exp $ */
/*
* Copyright (c) 2011 Gilles Chehade <gilles@openbsd.org>
@@ -32,6 +32,7 @@
#endif
enum filter_status {
+ STATUS_IGNORE,
STATUS_REJECT,
STATUS_ACCEPT,
STATUS_WAITING
diff --git a/usr.sbin/smtpd/mfa_session.c b/usr.sbin/smtpd/mfa_session.c
index 4d92262a181..585dee20383 100644
--- a/usr.sbin/smtpd/mfa_session.c
+++ b/usr.sbin/smtpd/mfa_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfa_session.c,v 1.5 2011/10/23 09:30:07 gilles Exp $ */
+/* $OpenBSD: mfa_session.c,v 1.6 2011/11/28 22:13:27 chl Exp $ */
/*
* Copyright (c) 2011 Gilles Chehade <gilles@openbsd.org>
@@ -144,7 +144,7 @@ mfa_session_proceed(struct mfa_session *ms)
void
mfa_session_pickup(struct mfa_session *ms)
{
- if (ms->fm.code == -1) {
+ if (ms->fm.code == STATUS_REJECT) {
mfa_session_fail(ms);
return;
}
@@ -288,7 +288,7 @@ mfa_session_imsg(int fd, short event, void *p)
ms->fm.code = fm.code;
/* success, overwrite */
- if (fm.code == 1)
+ if (fm.code == STATUS_ACCEPT)
ms->fm = fm;
mfa_session_pickup(ms);