X-Git-Url: http://git.meshlink.io/?p=meshlink;a=blobdiff_plain;f=src%2Fsolaris%2Fdevice.c;h=295a2f882d431d27c9f455e0e61d1c7173a88bc3;hp=748b54597b809773a12685b2e41045ba289faaad;hb=08aabbf9317806bc50a9a6693ca866c8936ce26b;hpb=43fa7283ac01f2ecc95381b519ef6b3342546f35 diff --git a/src/solaris/device.c b/src/solaris/device.c index 748b5459..295a2f88 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);