X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fdummy_device.c;h=4ffaf38f8a0da4979ad3b521b560f99aa6d5367c;hb=c45a3fd7319d03bd147448a017f5aaed3b46fdfe;hp=c43d586258503efdf6fd0a632fb7423a45f45848;hpb=41583d5dcfc1277b1a203478de4cce2cd0cda1b1;p=tinc diff --git a/src/dummy_device.c b/src/dummy_device.c index c43d5862..4ffaf38f 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(DEVICE_DUMMY); + iface = xstrdup(DEVICE_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; }