/*
device.c -- Interaction BSD tun/tap device
Copyright (C) 2001-2005 Ivo Timmermans,
- 2001-2017 Guus Sliepen <guus@tinc-vpn.org>
+ 2001-2021 Guus Sliepen <guus@tinc-vpn.org>
2009 Grzegorz Dymarek <gregd72002@googlemail.com>
This program is free software; you can redistribute it and/or modify
#include "../conf.h"
#include "../device.h"
#include "../logger.h"
-#include "../names.h"
-#include "../net.h"
#include "../route.h"
-#include "../utils.h"
#include "../xalloc.h"
#ifdef ENABLE_TUNEMU
return false;
}
- int unit = -1;
+ long unit = -1;
char *p = strstr(device, "utun"), *e = NULL;
if(p) {
}
static bool read_packet(vpn_packet_t *packet) {
- int inlen;
+ ssize_t inlen;
switch(device_type) {
case DEVICE_TYPE_TUN:
#ifdef ENABLE_TUNEMU
case DEVICE_TYPE_TUNEMU:
- if(tunemu_write(device_fd, DATA(packet) + 14, packet->len - 14) < 0) {
+ if(tunemu_write(DATA(packet) + 14, packet->len - 14) < 0) {
logger(DEBUG_ALWAYS, LOG_ERR, "Error while writing to %s %s: %s", device_info,
device, strerror(errno));
return false;