summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2013-12-06 14:12:35 +0000
committerEric Faurot <eric@cvs.openbsd.org>2013-12-06 14:12:35 +0000
commitf9a322074f4c1aac6ca6be7e09cd74313f0bb4fa (patch)
tree03f6153d1a378f39bcdd552d61d89d01338a7dd9 /usr.sbin
parentc5c85fd4a33e981251bdb3d13ecec7267a50febf (diff)
fix smtpctl resume route
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/control.c3
-rw-r--r--usr.sbin/smtpd/mta.c18
-rw-r--r--usr.sbin/smtpd/parser.c4
3 files changed, 19 insertions, 6 deletions
diff --git a/usr.sbin/smtpd/control.c b/usr.sbin/smtpd/control.c
index 72eea7b83b3..5ec9202da3c 100644
--- a/usr.sbin/smtpd/control.c
+++ b/usr.sbin/smtpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.92 2013/10/30 21:37:48 eric Exp $ */
+/* $OpenBSD: control.c,v 1.93 2013/12/06 14:12:34 eric Exp $ */
/*
* Copyright (c) 2012 Gilles Chehade <gilles@poolp.org>
@@ -688,7 +688,6 @@ control_dispatch_ext(struct mproc *p, struct imsg *imsg)
if (c->euid)
goto badcred;
- log_info("info: route resumed");
m_forward(p_mta, imsg);
m_compose(p, IMSG_CTL_OK, 0, 0, -1, NULL, 0);
return;
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c
index 9f9c5e6d2d7..d8f47a0ab18 100644
--- a/usr.sbin/smtpd/mta.c
+++ b/usr.sbin/smtpd/mta.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta.c,v 1.176 2013/12/05 09:26:47 eric Exp $ */
+/* $OpenBSD: mta.c,v 1.177 2013/12/06 14:12:34 eric Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -394,7 +394,21 @@ mta_imsg(struct mproc *p, struct imsg *imsg)
SPLAY_FOREACH(route, mta_route_tree, &routes) {
if (u64 && route->id != u64)
continue;
- mta_route_enable(route);
+
+ if (route->flags & ROUTE_DISABLED) {
+ log_info("smtp-out: Enabling route %s per admin request",
+ mta_route_to_text(route));
+ if (!runq_cancel(runq_route, NULL, route)) {
+ log_warnx("warn: route not on runq");
+ fatalx("exiting");
+ }
+ route->flags &= ~ROUTE_DISABLED;
+ route->flags |= ROUTE_NEW;
+ route->nerror = 0;
+ route->penalty = 0;
+ mta_route_unref(route); /* from mta_route_disable */
+ }
+
if (u64)
break;
}
diff --git a/usr.sbin/smtpd/parser.c b/usr.sbin/smtpd/parser.c
index 0c8d12db11d..849a16d6b40 100644
--- a/usr.sbin/smtpd/parser.c
+++ b/usr.sbin/smtpd/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.37 2013/10/26 12:27:59 eric Exp $ */
+/* $OpenBSD: parser.c,v 1.38 2013/12/06 14:12:34 eric Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -159,7 +159,7 @@ cmd_check(const char *str, struct node *node, struct parameter *res)
return (1);
case P_ROUTEID:
- res->u.u_int = strtonum(str, 1, LLONG_MAX, &e);
+ res->u.u_routeid = strtonum(str, 1, LLONG_MAX, &e);
if (e)
return (0);
return (1);