X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fmulticast_device.c;h=82f7fec03584ab405cb5b5a7a98753deb7b64180;hb=789146757ca0bc630492bf31ae48ede42b7b437a;hp=c19852bfca7f855ba5e0c9543f8e894bf3996d2d;hpb=f6e87ab476a0faf8b124ecaaa27f967d825e6457;p=tinc diff --git a/src/multicast_device.c b/src/multicast_device.c index c19852bf..82f7fec0 100644 --- a/src/multicast_device.c +++ b/src/multicast_device.c @@ -26,13 +26,12 @@ #include "logger.h" #include "netutl.h" #include "utils.h" -#include "route.h" #include "xalloc.h" -static char *device_info; +static const char *device_info = "multicast socket"; static struct addrinfo *ai = NULL; -static mac_t ignore_src = {{0}}; +static mac_t ignore_src = {0}; static bool setup_device(void) { char *host = NULL; @@ -40,8 +39,6 @@ static bool setup_device(void) { char *space; int ttl = 1; - device_info = "multicast socket"; - get_config_string(lookup_config(config_tree, "Interface"), &iface); if(!get_config_string(lookup_config(config_tree, "Device"), &device)) { @@ -182,7 +179,7 @@ static void close_device(void) { } static bool read_packet(vpn_packet_t *packet) { - int lenin; + ssize_t lenin; if((lenin = recv(device_fd, (void *)DATA(packet), MTU, 0)) <= 0) { logger(DEBUG_ALWAYS, LOG_ERR, "Error while reading from %s %s: %s", device_info, @@ -191,7 +188,7 @@ static bool read_packet(vpn_packet_t *packet) { } if(!memcmp(&ignore_src, DATA(packet) + 6, sizeof(ignore_src))) { - logger(DEBUG_SCARY_THINGS, LOG_DEBUG, "Ignoring loopback packet of %d bytes from %s", lenin, device_info); + logger(DEBUG_SCARY_THINGS, LOG_DEBUG, "Ignoring loopback packet of %zd bytes from %s", lenin, device_info); return false; }