X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsolaris%2Fdevice.c;h=d257ffdde2be1e621fa85150e62fddadc681ae0e;hb=a22041922f160667573e9a5ae3f4195e1668906a;hp=e26dc06c4d8ed84bcdc959692d8083ac9b8bf08e;hpb=430c90412c521c534113b3c4e5fc883e9b7ecff0;p=tinc diff --git a/src/solaris/device.c b/src/solaris/device.c index e26dc06c..d257ffdd 100644 --- a/src/solaris/device.c +++ b/src/solaris/device.c @@ -38,8 +38,8 @@ char *device = NULL; char *iface = NULL; static char *device_info = NULL; -static int device_total_in = 0; -static int device_total_out = 0; +static uint64_t device_total_in = 0; +static uint64_t device_total_out = 0; bool setup_device(void) { int ip_fd = -1, if_fd = -1; @@ -112,9 +112,9 @@ void close_device(void) { } bool read_packet(vpn_packet_t *packet) { - int lenin; + int inlen; - if((lenin = read(device_fd, packet->data + 14, MTU - 14)) <= 0) { + if((inlen = read(device_fd, packet->data + 14, MTU - 14)) <= 0) { logger(LOG_ERR, "Error while reading from %s %s: %s", device_info, device, strerror(errno)); return false; @@ -136,7 +136,7 @@ bool read_packet(vpn_packet_t *packet) { return false; } - packet->len = lenin + 14; + packet->len = inlen + 14; device_total_in += packet->len; @@ -163,6 +163,6 @@ bool write_packet(vpn_packet_t *packet) { void dump_device_stats(void) { logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device); - logger(LOG_DEBUG, " total bytes in: %10d", device_total_in); - logger(LOG_DEBUG, " total bytes out: %10d", device_total_out); + logger(LOG_DEBUG, " total bytes in: %10"PRIu64, device_total_in); + logger(LOG_DEBUG, " total bytes out: %10"PRIu64, device_total_out); }