projects
/
oweals
/
tinc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Consistently allocate device and iface variables on the heap.
[oweals/tinc.git]
/
src
/
raw_socket
/
device.c
diff --git
a/src/raw_socket/device.c
b/src/raw_socket/device.c
index 33857ba11ac5c37bb1ad35ce2568219dbd096e0a..b96f06f4e46a0f61600fa31168f7aa2471d49bd6 100644
(file)
--- 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 "logger.h"
#include "utils.h"
#include "route.h"
+#include "xalloc.h"
int device_fd = -1;
char *device;
char *iface;
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;
static int device_total_in = 0;
static int device_total_out = 0;
@@
-46,12
+47,11
@@
bool setup_device(void)
cp();
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))
if(!get_config_string(lookup_config(config_tree, "Device"), &device))
- device =
iface
;
+ device =
xstrdup(iface)
;
device_info = _("raw socket");
device_info = _("raw socket");