X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fuml_device.c;h=66de431b353764148eee1c72a43222d09bb73b7a;hp=4a03bb7bae9f2716ff991c24f5d268d3c9c8f77b;hb=26203e250433b846118be1b2e236bf2541aa260d;hpb=061c3fcaf9c63978009dc2707071f8daef8751b2 diff --git a/src/uml_device.c b/src/uml_device.c index 4a03bb7b..66de431b 100644 --- a/src/uml_device.c +++ b/src/uml_device.c @@ -181,10 +181,7 @@ void close_device(void) { unlink(device); free(device); - - if(iface) { - free(iface); - } + free(iface); } static bool read_packet(vpn_packet_t *packet) { @@ -235,7 +232,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; @@ -269,7 +266,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(); } }