blob: acc30c9f752218566daacc7a3c2d97b8537e6a1d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
diff --git a/src/uml_socket/device.c b/src/uml_socket/device.c
index a2da757..a371e7b 100644
--- a/src/uml_socket/device.c
+++ b/src/uml_socket/device.c
@@ -28,6 +28,7 @@
#include "logger.h"
#include "utils.h"
#include "route.h"
+#include "xalloc.h"
int device_fd = -1;
static int listen_fd = -1;
@@ -40,7 +41,7 @@ char *iface = NULL;
static char *device_info;
extern char *identname;
-extern bool running;
+extern volatile bool running;
static uint64_t device_total_in = 0;
static uint64_t device_total_out = 0;
@@ -175,7 +176,7 @@ bool read_packet(vpn_packet_t *packet) {
switch(state) {
case 0: {
struct sockaddr sa;
- int salen = sizeof sa;
+ socklen_t salen = sizeof sa;
request_fd = accept(listen_fd, &sa, &salen);
if(request_fd < 0) {
@@ -244,6 +245,10 @@ bool read_packet(vpn_packet_t *packet) {
return true;
}
+
+ default:
+ logger(LOG_ERR, "Invalid value for state variable in " __FILE__);
+ abort();
}
}
diff --git a/src/vde/device.c b/src/vde/device.c
index 63171f9..74cf3b6 100644
--- a/src/vde/device.c
+++ b/src/vde/device.c
@@ -39,7 +39,7 @@ char *iface = NULL;
static char *device_info;
extern char *identname;
-extern bool running;
+extern volatile bool running;
static uint64_t device_total_in = 0;
static uint64_t device_total_out = 0;
|