X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fbsd%2Fdevice.c;h=57029d5d7e0f6b387478146384f6bf2b3f8fdb51;hb=2c6b2d70e6640f39563ad7bb0aa0ba87f883848c;hp=86b4f1cc31f5b687f5e744225b20b1862e919e76;hpb=f8c1e74a5aeaca89fb58dbc78bb1580784fe7a78;p=tinc diff --git a/src/bsd/device.c b/src/bsd/device.c index 86b4f1cc..57029d5d 100644 --- a/src/bsd/device.c +++ b/src/bsd/device.c @@ -1,7 +1,7 @@ /* device.c -- Interaction BSD tun/tap device Copyright (C) 2001-2005 Ivo Timmermans, - 2001-2017 Guus Sliepen + 2001-2021 Guus Sliepen 2009 Grzegorz Dymarek This program is free software; you can redistribute it and/or modify @@ -24,10 +24,7 @@ #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 @@ -88,7 +85,7 @@ static bool setup_utun(void) { return false; } - int unit = -1; + long unit = -1; char *p = strstr(device, "utun"), *e = NULL; if(p) { @@ -354,7 +351,7 @@ static void close_device(void) { } static bool read_packet(vpn_packet_t *packet) { - int inlen; + ssize_t inlen; switch(device_type) { case DEVICE_TYPE_TUN: @@ -503,7 +500,7 @@ static bool write_packet(vpn_packet_t *packet) { #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;