From f129bdab552d21ae3cd77412342b94b5f23587b2 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 25 Sep 2017 04:22:09 +0200 Subject: netlink: switch from ioctl to netlink for configuration --- src/tools/set.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/tools/set.c') diff --git a/src/tools/set.c b/src/tools/set.c index 497edcc..57a6428 100644 --- a/src/tools/set.c +++ b/src/tools/set.c @@ -3,9 +3,11 @@ #include #include #include -#include "subcommands.h" + +#include "containers.h" #include "config.h" #include "ipc.h" +#include "subcommands.h" int set_main(int argc, char *argv[]) { @@ -17,10 +19,11 @@ int set_main(int argc, char *argv[]) return 1; } - if (!config_read_cmd(&device, argv + 2, argc - 2)) + device = config_read_cmd(argv + 2, argc - 2); + if (!device) goto cleanup; - strncpy(device->interface, argv[1], IFNAMSIZ - 1); - device->interface[IFNAMSIZ - 1] = 0; + strncpy(device->name, argv[1], IFNAMSIZ - 1); + device->name[IFNAMSIZ - 1] = 0; if (ipc_set_device(device) != 0) { perror("Unable to set device"); @@ -30,6 +33,6 @@ int set_main(int argc, char *argv[]) ret = 0; cleanup: - free(device); + free_wgdevice(device); return ret; } -- cgit v1.2.3-59-g8ed1b