summaryrefslogtreecommitdiffstats
path: root/usr.sbin/vmd/control.c
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2017-03-15 12:42:12 +0000
committerreyk <reyk@openbsd.org>2017-03-15 12:42:12 +0000
commit0d07b4d303bc75088c28bd21fb3074eca0d5aa0c (patch)
tree49668b8aba13aac1d8bbdfec2ac5cf1747e153bf /usr.sbin/vmd/control.c
parentMinimal support for deep linking into man(7) pages. (diff)
downloadwireguard-openbsd-0d07b4d303bc75088c28bd21fb3074eca0d5aa0c.tar.xz
wireguard-openbsd-0d07b4d303bc75088c28bd21fb3074eca0d5aa0c.zip
Don't terminate vmd(8) when we lost the control connection.
When a start vm request is received from vmctl via the control socket, vmd's control process forwards it to the parent to trigger the action. A response is received later, in an async way, and send back to vmctl that is supposed to wait for it. But now, if vmctl got terminated before receiving the response, vmd fails to find the control connection. In this case it should not abort, print and warning, and ignore the error. The fix is a simple as changing a return (-1) to a return (0). This fixes an issue that was reported by mlarkin@
Diffstat (limited to 'usr.sbin/vmd/control.c')
-rw-r--r--usr.sbin/vmd/control.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/vmd/control.c b/usr.sbin/vmd/control.c
index ff7ec7f0839..2f3d0d9e74b 100644
--- a/usr.sbin/vmd/control.c
+++ b/usr.sbin/vmd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.15 2017/03/01 07:43:33 reyk Exp $ */
+/* $OpenBSD: control.c,v 1.16 2017/03/15 12:42:12 reyk Exp $ */
/*
* Copyright (c) 2010-2015 Reyk Floeter <reyk@openbsd.org>
@@ -86,9 +86,9 @@ control_dispatch_vmd(int fd, struct privsep_proc *p, struct imsg *imsg)
case IMSG_VMDOP_GET_INFO_VM_DATA:
case IMSG_VMDOP_GET_INFO_VM_END_DATA:
if ((c = control_connbyfd(imsg->hdr.peerid)) == NULL) {
- log_warnx("%s: fd %d: not found",
+ log_warnx("%s: lost control connection: fd %d",
__func__, imsg->hdr.peerid);
- return (-1);
+ return (0);
}
imsg_compose_event(&c->iev, imsg->hdr.type,
0, 0, -1, imsg->data, IMSG_DATA_SIZE(imsg));