diff options
author | 2016-10-06 16:53:39 +0000 | |
---|---|---|
committer | 2016-10-06 16:53:39 +0000 | |
commit | 81994c8fdfbcaabec30cdeeda242ff0014f462ef (patch) | |
tree | 3ba849e1d2a533001142cd5fde2e6c4ffca9bd22 | |
parent | Add support for RFC 6842, which says the client MUST drop packets when (diff) | |
download | wireguard-openbsd-81994c8fdfbcaabec30cdeeda242ff0014f462ef.tar.xz wireguard-openbsd-81994c8fdfbcaabec30cdeeda242ff0014f462ef.zip |
The start control imsg has been switched to a new "struct
vmop_create_params" that also includes configuration that is only for
userland. I forgot to commit this chunk.
Found the hard way by mlarkin@
-rw-r--r-- | usr.sbin/vmctl/vmctl.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/vmctl/vmctl.c b/usr.sbin/vmctl/vmctl.c index 462a82a1a13..a590220987f 100644 --- a/usr.sbin/vmctl/vmctl.c +++ b/usr.sbin/vmctl/vmctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmctl.c,v 1.15 2016/05/10 11:00:54 mlarkin Exp $ */ +/* $OpenBSD: vmctl.c,v 1.16 2016/10/06 16:53:39 reyk Exp $ */ /* * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org> @@ -64,6 +64,7 @@ int start_vm(const char *name, int memsize, int nnics, int ndisks, char **disks, char *kernel) { + struct vmop_create_params *vmc; struct vm_create_params *vcp; int i; @@ -80,11 +81,12 @@ start_vm(const char *name, int memsize, int nnics, int ndisks, char **disks, if (nnics == 0) warnx("starting without network interfaces"); - vcp = malloc(sizeof(struct vm_create_params)); - if (vcp == NULL) + vmc = calloc(1, sizeof(struct vmop_create_params)); + if (vmc == NULL) return (ENOMEM); - bzero(vcp, sizeof(struct vm_create_params)); + /* vcp includes configuration that is shared with the kernel */ + vcp = &vmc->vmc_params; /* * XXX: vmd(8) fills in the actual memory ranges. vmctl(8) @@ -105,7 +107,7 @@ start_vm(const char *name, int memsize, int nnics, int ndisks, char **disks, vcp->vcp_nnics = nnics; imsg_compose(ibuf, IMSG_VMDOP_START_VM_REQUEST, 0, 0, -1, - vcp, sizeof(struct vm_create_params)); + vmc, sizeof(struct vmop_create_params)); free(vcp); return (0); |