X-Git-Url: https://git.librecmc.org/?p=oweals%2Ftinc.git;a=blobdiff_plain;f=src%2Fraw_socket%2Fdevice.c;h=b96f06f4e46a0f61600fa31168f7aa2471d49bd6;hp=33857ba11ac5c37bb1ad35ce2568219dbd096e0a;hb=b069da90d67b49dce041f513a3855b8da3d82f80;hpb=f81cea3bdc8683b27188cd8f24a2de906a29eb81 diff --git a/src/raw_socket/device.c b/src/raw_socket/device.c index 33857ba..b96f06f 100644 --- a/src/raw_socket/device.c +++ b/src/raw_socket/device.c @@ -29,12 +29,13 @@ #include "logger.h" #include "utils.h" #include "route.h" +#include "xalloc.h" int device_fd = -1; char *device; char *iface; -char ifrname[IFNAMSIZ]; -char *device_info; +static char ifrname[IFNAMSIZ]; +static char *device_info; static int device_total_in = 0; static int device_total_out = 0; @@ -46,12 +47,11 @@ bool setup_device(void) cp(); - if(!get_config_string - (lookup_config(config_tree, "Interface"), &iface)) - iface = "eth0"; + if(!get_config_string(lookup_config(config_tree, "Interface"), &iface)) + iface = xstrdup("eth0"); if(!get_config_string(lookup_config(config_tree, "Device"), &device)) - device = iface; + device = xstrdup(iface); device_info = _("raw socket");