X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fuml_device.c;h=68f4cd251aad969acec7a7870592291b3de3d39c;hb=refs%2Ftags%2Frelease-1.1pre15;hp=f2b52cbbc2c9c912762d009ba942bc7067d1fdb2;hpb=ed1d0878afe53032a4b63e87afd4a435015cf5de;p=tinc diff --git a/src/uml_device.c b/src/uml_device.c index f2b52cbb..68f4cd25 100644 --- a/src/uml_device.c +++ b/src/uml_device.c @@ -1,7 +1,7 @@ /* device.c -- UML network socket Copyright (C) 2002-2005 Ivo Timmermans, - 2002-2013 Guus Sliepen + 2002-2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -228,7 +228,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 sockkadr *)&request.sock, sizeof request.sock) < 0) { logger(DEBUG_ALWAYS, LOG_ERR, "Could not bind write %s: %s", device_info, strerror(errno)); event_exit(); return false; @@ -244,7 +244,7 @@ static bool read_packet(vpn_packet_t *packet) { } case 2: { - if((inlen = read(data_fd, packet->data, MTU)) <= 0) { + if((inlen = read(data_fd, DATA(packet), MTU)) <= 0) { logger(DEBUG_ALWAYS, LOG_ERR, "Error while reading from %s %s: %s", device_info, device, strerror(errno)); event_exit(); @@ -275,7 +275,7 @@ static bool write_packet(vpn_packet_t *packet) { logger(DEBUG_TRAFFIC, LOG_DEBUG, "Writing packet of %d bytes to %s", packet->len, device_info); - if(write(write_fd, packet->data, packet->len) < 0) { + if(write(write_fd, DATA(packet), packet->len) < 0) { if(errno != EINTR && errno != EAGAIN) { logger(DEBUG_ALWAYS, LOG_ERR, "Can't write to %s %s: %s", device_info, device, strerror(errno)); event_exit();