summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2017-04-13 15:32:15 +0000
committertedu <tedu@openbsd.org>2017-04-13 15:32:15 +0000
commitd89fc558970a460c2ae42fed53e66b8ce71de5fe (patch)
tree273048e7f665d268497b61530fb2d75198dfa34b
parentRemove a bunch of obsolete, unused and irrelevant DHCP client types, fields, (diff)
downloadwireguard-openbsd-d89fc558970a460c2ae42fed53e66b8ce71de5fe.tar.xz
wireguard-openbsd-d89fc558970a460c2ae42fed53e66b8ce71de5fe.zip
moving some code into a switch meant that break no longer stopped the loop.
try harder with a goto. diagnosis and original fix by tb.
-rw-r--r--usr.sbin/rebound/rebound.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/rebound/rebound.c b/usr.sbin/rebound/rebound.c
index 9cba6618028..a33029cd9bc 100644
--- a/usr.sbin/rebound/rebound.c
+++ b/usr.sbin/rebound/rebound.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rebound.c,v 1.81 2017/04/06 21:16:14 tedu Exp $ */
+/* $OpenBSD: rebound.c,v 1.82 2017/04/13 15:32:15 tedu Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@ -848,7 +848,7 @@ monitorloop(int ud, int ld, int ud6, int ld6, const char *confname)
logmsg(LOG_INFO, "received HUP, restarting");
hupped = 1;
if (childdead)
- break;
+ goto doublebreak;
kill(child, SIGHUP);
} else if (kev.ident == SIGTERM) {
/* good bye */
@@ -862,7 +862,7 @@ monitorloop(int ud, int ld, int ud6, int ld6, const char *confname)
logmsg(LOG_INFO, "observed child exit");
childdead = 1;
if (hupped)
- break;
+ goto doublebreak;
memset(&ts, 0, sizeof(ts));
ts.tv_sec = 1;
timeout = &ts;
@@ -872,6 +872,7 @@ monitorloop(int ud, int ld, int ud6, int ld6, const char *confname)
break;
}
}
+doublebreak:
wait(NULL);
}
return 1;