X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fuml_device.c;h=49f26ffeb2054b1b9a419c6ee09918bb99c90486;hp=ee9e03f4291419aa3372348888b2053b543f9178;hb=63c4e8e5fd1d872d80ed9830ba8dfe2448622005;hpb=afda1d91ae290ac2aa2a45d07fa6838b3159da39 diff --git a/src/uml_device.c b/src/uml_device.c index ee9e03f4..49f26ffe 100644 --- a/src/uml_device.c +++ b/src/uml_device.c @@ -35,7 +35,7 @@ static int request_fd = -1; 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; @@ -70,8 +70,6 @@ static bool setup_device(void) { 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; @@ -237,7 +235,7 @@ 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; @@ -271,7 +269,7 @@ static bool read_packet(vpn_packet_t *packet) { } default: - logger(LOG_ERR, "Invalid value for state variable in " FILE); + logger(LOG_ERR, "Invalid value for state variable in " __FILE__); abort(); } }