X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsolaris%2Fdevice.c;h=d257ffdde2be1e621fa85150e62fddadc681ae0e;hb=a22041922f160667573e9a5ae3f4195e1668906a;hp=43938006b36cf1de794d05c9b94c12e89061d96d;hpb=4c85542894f7fca823b119b05e07179deb24229a;p=tinc diff --git a/src/solaris/device.c b/src/solaris/device.c index 43938006..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; @@ -131,12 +131,12 @@ bool read_packet(vpn_packet_t *packet) { break; default: ifdebug(TRAFFIC) logger(LOG_ERR, - _ ("Unknown IP version %d while reading packet from %s %s"), + "Unknown IP version %d while reading packet from %s %s", packet->data[14] >> 4, device_info, device); 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); }