]> git.meshlink.io Git - meshlink/blobdiff - src/solaris/device.c
Merge branch 'master' into 1.1
[meshlink] / src / solaris / device.c
index f76bbbd5feeb4c87db1543d64497c52eb142661a..a258e34e34f8097cd1c28c43a7eca74771d9fd20 100644 (file)
@@ -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);