From: Guus Sliepen Date: Tue, 10 Mar 2020 21:54:45 +0000 (+0100) Subject: Fix some log messages being reported for the wrong log levels. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=0b6635bd9460ba2f9aeafddd2aef79929cd417a1;p=meshlink Fix some log messages being reported for the wrong log levels. --- diff --git a/src/net_packet.c b/src/net_packet.c index 953887a5..2d3d7c77 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -559,7 +559,7 @@ void handle_incoming_vpn_data(event_loop_t *loop, void *data, int flags) { if(n) { update_node_udp(mesh, n, &from); - } else if(mesh->log_level >= MESHLINK_WARNING) { + } else if(mesh->log_level <= MESHLINK_WARNING) { hostname = sockaddr2hostname(&from); logger(mesh, MESHLINK_WARNING, "Received UDP packet from unknown source %s", hostname); free(hostname); diff --git a/src/net_setup.c b/src/net_setup.c index b9cddeb0..4cff1a5e 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -389,7 +389,7 @@ static bool add_listen_sockets(meshlink_handle_t *mesh) { io_add(&mesh->loop, &mesh->listen_socket[mesh->listen_sockets].tcp, handle_new_meta_connection, &mesh->listen_socket[mesh->listen_sockets], tcp_fd, IO_READ); io_add(&mesh->loop, &mesh->listen_socket[mesh->listen_sockets].udp, handle_incoming_vpn_data, &mesh->listen_socket[mesh->listen_sockets], udp_fd, IO_READ); - if(mesh->log_level >= MESHLINK_INFO) { + if(mesh->log_level <= MESHLINK_INFO) { char *hostname = sockaddr2hostname((sockaddr_t *) aip->ai_addr); logger(mesh, MESHLINK_INFO, "Listening on %s", hostname); free(hostname);