X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fdummy_device.c;h=94c71ea0ca973de71577206476921cee8f5a0259;hb=8c10a4131f19dc27b0bc56ef48ae481d1fa03cb0;hp=c43d586258503efdf6fd0a632fb7423a45f45848;hpb=41583d5dcfc1277b1a203478de4cce2cd0cda1b1;p=tinc diff --git a/src/dummy_device.c b/src/dummy_device.c index c43d5862..94c71ea0 100644 --- a/src/dummy_device.c +++ b/src/dummy_device.c @@ -22,24 +22,31 @@ #include "device.h" #include "logger.h" #include "net.h" +#include "xalloc.h" -static char *device_info = "dummy device"; +static const char *device_info = "dummy device"; static bool setup_device(void) { - device = "dummy"; - iface = "dummy"; + device = xstrdup("dummy"); + iface = xstrdup("dummy"); logger(DEBUG_ALWAYS, LOG_INFO, "%s (%s) is a %s", device, iface, device_info); return true; } static void close_device(void) { + free(iface); + iface = NULL; + free(device); + device = NULL; } static bool read_packet(vpn_packet_t *packet) { + (void)packet; return false; } static bool write_packet(vpn_packet_t *packet) { + (void)packet; return true; }