summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2016-09-04 16:55:44 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2016-09-04 16:55:44 +0000
commit50f17ff10334171601bc97b1678c916ecb73db67 (patch)
treea27556d17c1733f51601fe8f8d35170a26bd2cbf
parent8934c06a6279ef26b8446849b797b45c91972fc6 (diff)
Forward IMSG_CTL_VERBOSE via the parent; this fixes a crash when doing
"ikectl log verbose" and keeps the control process separated from the cert process. Thanks for the bug report to Wouter Clarie OK vgross@
-rw-r--r--sbin/iked/control.c3
-rw-r--r--sbin/iked/iked.c8
2 files changed, 8 insertions, 3 deletions
diff --git a/sbin/iked/control.c b/sbin/iked/control.c
index 32ef9e60397..94f4dbc7329 100644
--- a/sbin/iked/control.c
+++ b/sbin/iked/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.21 2015/12/05 13:09:46 claudio Exp $ */
+/* $OpenBSD: control.c,v 1.22 2016/09/04 16:55:43 reyk Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -306,7 +306,6 @@ control_dispatch_imsg(int fd, short event, void *arg)
log_verbose(v);
proc_forward_imsg(&env->sc_ps, &imsg, PROC_PARENT, -1);
- proc_forward_imsg(&env->sc_ps, &imsg, PROC_IKEV2, -1);
break;
case IMSG_CTL_RELOAD:
case IMSG_CTL_RESET:
diff --git a/sbin/iked/iked.c b/sbin/iked/iked.c
index 11b54ca930d..8ebedb2e837 100644
--- a/sbin/iked/iked.c
+++ b/sbin/iked/iked.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iked.c,v 1.30 2015/12/07 12:46:37 reyk Exp $ */
+/* $OpenBSD: iked.c,v 1.31 2016/09/04 16:55:43 reyk Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -391,6 +391,12 @@ parent_dispatch_control(int fd, struct privsep_proc *p, struct imsg *imsg)
parent_reload(env, 0, str);
free(str);
break;
+ case IMSG_CTL_VERBOSE:
+ proc_forward_imsg(&env->sc_ps, imsg, PROC_IKEV2, -1);
+ proc_forward_imsg(&env->sc_ps, imsg, PROC_CERT, -1);
+
+ /* return 1 to let proc.c handle it locally */
+ return (1);
default:
return (-1);
}