From 8108b0d5eb8603595a29c1b6fa9acc89f8284fe3 Mon Sep 17 00:00:00 2001 From: thorkill Date: Mon, 29 Jun 2015 00:45:00 +0200 Subject: [PATCH] make usage of function parameters --- src/dummy_device.c | 6 ++++++ src/meta.c | 2 +- src/net_packet.c | 5 ++++- src/net_socket.c | 4 ++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/dummy_device.c b/src/dummy_device.c index c43d5862..10000c6e 100644 --- a/src/dummy_device.c +++ b/src/dummy_device.c @@ -36,10 +36,16 @@ static void close_device(void) { } static bool read_packet(vpn_packet_t *packet) { + // silence unsued parameter error + if (packet) + return false; return false; } static bool write_packet(vpn_packet_t *packet) { + // silence unsued parameter error + if (packet) + return true; return true; } diff --git a/src/meta.c b/src/meta.c index ff06d0ce..9038ff85 100644 --- a/src/meta.c +++ b/src/meta.c @@ -38,7 +38,7 @@ bool send_meta_sptps(void *handle, uint8_t type, const void *buffer, size_t leng connection_t *c = handle; if(!c) { - logger(DEBUG_ALWAYS, LOG_ERR, "send_meta_sptps() called with NULL pointer!"); + logger(DEBUG_ALWAYS, LOG_ERR, "send_meta_sptps() called with NULL pointer! [type: %d]", type); abort(); } diff --git a/src/net_packet.c b/src/net_packet.c index a95e9771..91a642ca 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -1406,7 +1406,7 @@ void handle_incoming_vpn_data(void *data, int flags) { if(len <= 0 || len > MAXSIZE) { if(!sockwouldblock(sockerrno)) - logger(DEBUG_ALWAYS, LOG_ERR, "Receiving packet failed: %s", sockstrerror(sockerrno)); + logger(DEBUG_ALWAYS, LOG_ERR, "Receiving packet failed: %s [flags: %x]", sockstrerror(sockerrno), flags); return; } @@ -1514,6 +1514,9 @@ skip_harder: void handle_device_data(void *data, int flags) { vpn_packet_t packet; + + logger(DEBUG_TRAFFIC, LOG_INFO, "Handle device data at 0x%x flags 0x%x", data, flags); + packet.offset = DEFAULT_PACKET_OFFSET; packet.priority = 0; diff --git a/src/net_socket.c b/src/net_socket.c index 8acd4b45..dede7d6c 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -639,7 +639,7 @@ void handle_new_meta_connection(void *data, int flags) { fd = accept(l->tcp.fd, &sa.sa, &len); if(fd < 0) { - logger(DEBUG_ALWAYS, LOG_ERR, "Accepting a new connection failed: %s", sockstrerror(sockerrno)); + logger(DEBUG_ALWAYS, LOG_ERR, "Accepting a new connection failed: %s, data at 0x%x flags 0x%x", sockstrerror(sockerrno), data, flags); return; } @@ -736,7 +736,7 @@ void handle_new_unix_connection(void *data, int flags) { fd = accept(io->fd, &sa.sa, &len); if(fd < 0) { - logger(DEBUG_ALWAYS, LOG_ERR, "Accepting a new connection failed: %s", sockstrerror(sockerrno)); + logger(DEBUG_ALWAYS, LOG_ERR, "Accepting a new connection failed: %s data at 0x%x flags 0x%x", sockstrerror(sockerrno), data, flags); return; }