diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2017-11-04 17:23:06 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2017-11-04 17:23:06 +0000 |
commit | f62b8a875ce265c1684cc9af05545b04e3b21b9a (patch) | |
tree | 447adfd031443f57e510c374606f7c4512131201 /sbin/slaacd | |
parent | e4d60f62460f6d50537d8ec433034313bcdee967 (diff) |
Don't keep blindly chugging along when receiving an unexpected imsg,
something is seriously wrong.
Diffstat (limited to 'sbin/slaacd')
-rw-r--r-- | sbin/slaacd/engine.c | 15 | ||||
-rw-r--r-- | sbin/slaacd/frontend.c | 15 |
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) |