diff options
author | 2012-07-29 16:33:01 +0000 | |
---|---|---|
committer | 2012-07-29 16:33:01 +0000 | |
commit | fcb40112660680fd5c1d0fce856170b6464b4409 (patch) | |
tree | 9c3f21b2ee3bb7a5e1fc5e0abfe4480650ce17e2 | |
parent | Disable hyphenation and, for nroff, disable justification which is (diff) | |
download | wireguard-openbsd-fcb40112660680fd5c1d0fce856170b6464b4409.tar.xz wireguard-openbsd-fcb40112660680fd5c1d0fce856170b6464b4409.zip |
get rid of A_INVALID.
little code cleanup while here.
ok gilles@
-rw-r--r-- | usr.sbin/smtpd/lka_session.c | 19 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.h | 4 |
2 files changed, 7 insertions, 16 deletions
diff --git a/usr.sbin/smtpd/lka_session.c b/usr.sbin/smtpd/lka_session.c index 87fc63f8f76..b0b1423ad21 100644 --- a/usr.sbin/smtpd/lka_session.c +++ b/usr.sbin/smtpd/lka_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka_session.c,v 1.17 2012/07/12 08:51:43 chl Exp $ */ +/* $OpenBSD: lka_session.c,v 1.18 2012/07/29 16:33:01 eric Exp $ */ /* * Copyright (c) 2011 Gilles Chehade <gilles@openbsd.org> @@ -379,27 +379,20 @@ void lka_session_deliver(struct lka_session *lks, struct envelope *ep) { struct envelope *new_ep; - struct delivery_mda *d_mda; new_ep = calloc(1, sizeof (*ep)); if (new_ep == NULL) fatal("lka_session_deliver: calloc"); *new_ep = *ep; if (new_ep->type == D_MDA) { - d_mda = &new_ep->agent.mda; - if (d_mda->method == A_INVALID) - fatalx("lka_session_deliver: mda method == A_INVALID"); - - switch (d_mda->method) { + switch (new_ep->agent.mda.method) { case A_MAILDIR: case A_FILENAME: - case A_MDA: { - char *buf = d_mda->to.buffer; - size_t bufsz = sizeof(d_mda->to.buffer); - if (! lka_session_expand_format(buf, bufsz, new_ep)) + case A_MDA: + if (! lka_session_expand_format( + new_ep->agent.mda.to.buffer, + sizeof(new_ep->agent.mda.to.buffer), new_ep)) lks->flags |= F_ERROR; - break; - } default: break; } diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index ad1cb032946..ac91a836c58 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.311 2012/07/29 13:56:24 eric Exp $ */ +/* $OpenBSD: smtpd.h,v 1.312 2012/07/29 16:33:01 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -295,7 +295,6 @@ struct cond { }; enum action_type { - A_INVALID, A_RELAY, A_RELAYVIA, A_MAILDIR, @@ -306,7 +305,6 @@ enum action_type { #define IS_MAILBOX(x) ((x).r_action == A_MAILDIR || (x).r_action == A_MBOX || (x).r_action == A_FILENAME) #define IS_RELAY(x) ((x).r_action == A_RELAY || (x).r_action == A_RELAYVIA) -#define IS_EXT(x) ((x).r_action == A_EXT) struct rule { TAILQ_ENTRY(rule) r_entry; |