static int data_fd = -1;
static int write_fd = -1;
static int state = 0;
-static char *device_info;
+static const char *device_info = "UML network socket";
extern char *identname;
extern volatile bool running;
get_config_string(lookup_config(config_tree, "Interface"), &iface);
- device_info = "UML network socket";
-
if((write_fd = socket(PF_UNIX, SOCK_DGRAM, 0)) < 0) {
logger(LOG_ERR, "Could not open write %s: %s", device_info, strerror(errno));
running = false;
unlink(device);
free(device);
-
- if(iface) {
- free(iface);
- }
+ free(iface);
}
static bool read_packet(vpn_packet_t *packet) {
return false;
}
- if(connect(write_fd, &request.sock, sizeof(request.sock)) < 0) {
+ if(connect(write_fd, (struct sockaddr *)&request.sock, sizeof(request.sock)) < 0) {
logger(LOG_ERR, "Could not bind write %s: %s", device_info, strerror(errno));
running = false;
return false;
}
default:
- logger(LOG_ERR, "Invalid value for state variable in " FILE);
+ logger(LOG_ERR, "Invalid value for state variable in " __FILE__);
abort();
}
}