]> git.meshlink.io Git - meshlink/commitdiff
Fix some log messages being reported for the wrong log levels.
authorGuus Sliepen <guus@meshlink.io>
Tue, 10 Mar 2020 21:54:45 +0000 (22:54 +0100)
committerGuus Sliepen <guus@meshlink.io>
Tue, 10 Mar 2020 21:54:45 +0000 (22:54 +0100)
src/net_packet.c
src/net_setup.c

index 953887a53d3eed52c741c76712fb7ccffb42f263..2d3d7c7711c78f0769131c37ef6976e2bbc107ba 100644 (file)
@@ -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);
index b9cddeb00ccc2c7bd73dc69710ef7d148b63156c..4cff1a5ee83d679ff952fe181cf0c84fbe738d07 100644 (file)
@@ -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);