summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2019-02-17 14:51:04 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2019-02-17 14:51:04 +0000
commit31e3030aa150b5668473f6aa9c0df30750049abb (patch)
tree2b4ccf50f08264c7c9645fcab3ad1b1834446e86
parent33dd12dcdbd371736cbca0b3b78f14ee5d883dfd (diff)
Pass verbosity changes to captive portal process.
-rw-r--r--sbin/unwind/captiveportal.c12
-rw-r--r--sbin/unwind/control.c5
2 files changed, 14 insertions, 3 deletions
diff --git a/sbin/unwind/captiveportal.c b/sbin/unwind/captiveportal.c
index 10df16b704c..f9967f040b1 100644
--- a/sbin/unwind/captiveportal.c
+++ b/sbin/unwind/captiveportal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: captiveportal.c,v 1.4 2019/02/17 14:49:15 florian Exp $ */
+/* $OpenBSD: captiveportal.c,v 1.5 2019/02/17 14:51:03 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -475,7 +475,7 @@ captiveportal_dispatch_frontend(int fd, short event, void *bula)
struct imsgev *iev = bula;
struct imsgbuf *ibuf = &iev->ibuf;
struct imsg imsg;
- int n, shut = 0;
+ int n, verbose, shut = 0;
if (event & EV_READ) {
if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
@@ -497,6 +497,14 @@ captiveportal_dispatch_frontend(int fd, short event, void *bula)
break;
switch (imsg.hdr.type) {
+ case IMSG_CTL_LOG_VERBOSE:
+ if (imsg.hdr.len != IMSG_HEADER_SIZE +
+ sizeof(verbose))
+ fatalx("%s: IMSG_CTL_LOG_VERBOSE wrong length: "
+ "%d", __func__, imsg.hdr.len);
+ memcpy(&verbose, imsg.data, sizeof(verbose));
+ log_setverbose(verbose);
+ break;
default:
log_debug("%s: error handling imsg %d", __func__,
imsg.hdr.type);
diff --git a/sbin/unwind/control.c b/sbin/unwind/control.c
index 0589904ff2d..f90fef463b7 100644
--- a/sbin/unwind/control.c
+++ b/sbin/unwind/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.7 2019/02/17 14:49:15 florian Exp $ */
+/* $OpenBSD: control.c,v 1.8 2019/02/17 14:51:03 florian Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -272,6 +272,9 @@ control_dispatch_imsg(int fd, short event, void *bula)
frontend_imsg_compose_resolver(imsg.hdr.type,
imsg.hdr.pid, imsg.data,
imsg.hdr.len - IMSG_HEADER_SIZE);
+ frontend_imsg_compose_captiveportal(imsg.hdr.type,
+ imsg.hdr.pid, imsg.data,
+ imsg.hdr.len - IMSG_HEADER_SIZE);
memcpy(&verbose, imsg.data, sizeof(verbose));
log_setverbose(verbose);