X-Git-Url: http://git.meshlink.io/?p=meshlink;a=blobdiff_plain;f=src%2Fsolaris%2Fdevice.c;h=a258e34e34f8097cd1c28c43a7eca74771d9fd20;hp=f76bbbd5feeb4c87db1543d64497c52eb142661a;hb=075e6828a7533e7daa790225f17aa6bb39703278;hpb=b5ccce296848aab72d574ca3de14af5fdf3efa4d diff --git a/src/solaris/device.c b/src/solaris/device.c index f76bbbd5..a258e34e 100644 --- a/src/solaris/device.c +++ b/src/solaris/device.c @@ -43,8 +43,7 @@ static char *device_info = NULL; static int device_total_in = 0; static int device_total_out = 0; -bool setup_device(void) -{ +bool setup_device(void) { int ip_fd = -1, if_fd = -1; int ppa; char *ptr; @@ -109,8 +108,7 @@ bool setup_device(void) return true; } -void close_device(void) -{ +void close_device(void) { cp(); close(device_fd); @@ -119,13 +117,12 @@ void close_device(void) free(iface); } -bool read_packet(vpn_packet_t *packet) -{ - int lenin; +bool read_packet(vpn_packet_t *packet) { + int inlen; cp(); - 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; @@ -147,7 +144,7 @@ bool read_packet(vpn_packet_t *packet) return false; } - packet->len = lenin + 14; + packet->len = inlen + 14; device_total_in += packet->len; @@ -157,8 +154,7 @@ bool read_packet(vpn_packet_t *packet) return true; } -bool write_packet(vpn_packet_t *packet) -{ +bool write_packet(vpn_packet_t *packet) { cp(); ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Writing packet of %d bytes to %s"), @@ -175,8 +171,7 @@ bool write_packet(vpn_packet_t *packet) return true; } -void dump_device_stats(void) -{ +void dump_device_stats(void) { cp(); logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);