X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsolaris%2Fdevice.c;h=25f66f389c822f63b51ecae82758b8e78b0f58aa;hb=551cd19406a560d0d206bff5b4e9da064ec222b6;hp=9c2a762a65ccb570f5eff47cb483249340119ef4;hpb=de78d79db84c486afcc353884ec1770866beb653;p=tinc diff --git a/src/solaris/device.c b/src/solaris/device.c index 9c2a762a..25f66f38 100644 --- a/src/solaris/device.c +++ b/src/solaris/device.c @@ -42,8 +42,7 @@ 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; @@ -108,20 +107,18 @@ bool setup_device(void) return true; } -void close_device(void) -{ +void close_device(void) { cp(); close(device_fd); } -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; @@ -143,7 +140,7 @@ bool read_packet(vpn_packet_t *packet) return false; } - packet->len = lenin + 14; + packet->len = inlen + 14; device_total_in += packet->len; @@ -153,8 +150,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"), @@ -171,8 +167,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);