Fix compilation of VDE and UML interfaces.

This commit is contained in:
Guus Sliepen 2011-11-27 12:12:34 +01:00
parent ddea7a23a6
commit 2c7c87ec75
2 changed files with 8 additions and 3 deletions

View file

@ -28,6 +28,7 @@
#include "logger.h" #include "logger.h"
#include "utils.h" #include "utils.h"
#include "route.h" #include "route.h"
#include "xalloc.h"
int device_fd = -1; int device_fd = -1;
static int listen_fd = -1; static int listen_fd = -1;
@ -40,7 +41,7 @@ char *iface = NULL;
static char *device_info; static char *device_info;
extern char *identname; extern char *identname;
extern bool running; extern volatile bool running;
static uint64_t device_total_in = 0; static uint64_t device_total_in = 0;
static uint64_t device_total_out = 0; static uint64_t device_total_out = 0;
@ -175,7 +176,7 @@ bool read_packet(vpn_packet_t *packet) {
switch(state) { switch(state) {
case 0: { case 0: {
struct sockaddr sa; struct sockaddr sa;
int salen = sizeof sa; socklen_t salen = sizeof sa;
request_fd = accept(listen_fd, &sa, &salen); request_fd = accept(listen_fd, &sa, &salen);
if(request_fd < 0) { if(request_fd < 0) {
@ -244,6 +245,10 @@ bool read_packet(vpn_packet_t *packet) {
return true; return true;
} }
default:
logger(LOG_ERR, "Invalid value for state variable in " __FILE__);
abort();
} }
} }

View file

@ -39,7 +39,7 @@ char *iface = NULL;
static char *device_info; static char *device_info;
extern char *identname; extern char *identname;
extern bool running; extern volatile bool running;
static uint64_t device_total_in = 0; static uint64_t device_total_in = 0;
static uint64_t device_total_out = 0; static uint64_t device_total_out = 0;