Add stricter checks for netnames.
[tinc] / src / uml_device.c
index f2b52cb..57d4843 100644 (file)
@@ -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();