]> git.meshlink.io Git - meshlink/commitdiff
Fix compilation of VDE and UML interfaces.
authorGuus Sliepen <guus@tinc-vpn.org>
Sun, 27 Nov 2011 11:12:34 +0000 (12:12 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 27 Nov 2011 11:12:34 +0000 (12:12 +0100)
src/uml_socket/device.c
src/vde/device.c

index a2da75759c2aa1fa7f132dffe9c42e7e6bb389fa..a371e7b439eb1cb1efb0b8199aef2291054032f0 100644 (file)
@@ -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();
        }
 }
 
index 63171f9a026b0d9644aa0a7ed092ff94e162d203..74cf3b676a7c4cbeb7754dcc150327f19c70a536 100644 (file)
@@ -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;