summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2017-11-04 17:23:05 +0000
committerflorian <florian@openbsd.org>2017-11-04 17:23:05 +0000
commit58a273d84b7b7346584c4f25fdbc1cb30b4a15f9 (patch)
tree21775d481e69c656483ceacc62d8f50051c02685
parentMove the ioctls that only need a read lock from ifioctl into a new (diff)
downloadwireguard-openbsd-58a273d84b7b7346584c4f25fdbc1cb30b4a15f9.tar.xz
wireguard-openbsd-58a273d84b7b7346584c4f25fdbc1cb30b4a15f9.zip
Don't keep blindly chugging along when receiving an unexpected imsg,
something is seriously wrong.
-rw-r--r--sbin/slaacd/engine.c15
-rw-r--r--sbin/slaacd/frontend.c15
2 files changed, 12 insertions, 18 deletions
diff --git a/sbin/slaacd/engine.c b/sbin/slaacd/engine.c
index 7f443759d61..23ff8ec3534 100644
--- a/sbin/slaacd/engine.c
+++ b/sbin/slaacd/engine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.c,v 1.18 2017/08/23 15:49:08 florian Exp $ */
+/* $OpenBSD: engine.c,v 1.19 2017/11/04 17:23:05 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -573,16 +573,13 @@ engine_dispatch_main(int fd, short event, void *bula)
* Setup pipe and event handler to the frontend
* process.
*/
- if (iev_frontend) {
- log_warnx("%s: received unexpected imsg fd "
+ if (iev_frontend)
+ fatalx("%s: received unexpected imsg fd "
"to engine", __func__);
- break;
- }
- if ((fd = imsg.fd) == -1) {
- log_warnx("%s: expected to receive imsg fd to "
+
+ if ((fd = imsg.fd) == -1)
+ fatalx("%s: expected to receive imsg fd to "
"engine but didn't receive any", __func__);
- break;
- }
iev_frontend = malloc(sizeof(struct imsgev));
if (iev_frontend == NULL)
diff --git a/sbin/slaacd/frontend.c b/sbin/slaacd/frontend.c
index bd5e45023aa..8998e3d2785 100644
--- a/sbin/slaacd/frontend.c
+++ b/sbin/slaacd/frontend.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: frontend.c,v 1.8 2017/08/23 10:48:01 florian Exp $ */
+/* $OpenBSD: frontend.c,v 1.9 2017/11/04 17:23:05 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -349,17 +349,14 @@ frontend_dispatch_main(int fd, short event, void *bula)
* Setup pipe and event handler to the engine
* process.
*/
- if (iev_engine) {
- log_warnx("%s: received unexpected imsg fd "
+ if (iev_engine)
+ fatalx("%s: received unexpected imsg fd "
"to frontend", __func__);
- break;
- }
- if ((fd = imsg.fd) == -1) {
- log_warnx("%s: expected to receive imsg fd to "
+
+ if ((fd = imsg.fd) == -1)
+ fatalx("%s: expected to receive imsg fd to "
"frontend but didn't receive any",
__func__);
- break;
- }
iev_engine = malloc(sizeof(struct imsgev));
if (iev_engine == NULL)