Fix sparse warnings and add an extra sprinkling of const.
[tinc] / src / raw_socket / device.c
index 30bb184..abe368a 100644 (file)
@@ -23,6 +23,7 @@
 #include <netpacket/packet.h>
 
 #include "conf.h"
+#include "device.h"
 #include "net.h"
 #include "logger.h"
 #include "utils.h"
@@ -35,8 +36,8 @@ char *iface = NULL;
 static char ifrname[IFNAMSIZ];
 static char *device_info;
 
-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) {
        struct ifreq ifr;
@@ -123,6 +124,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);
 }