]> git.meshlink.io Git - meshlink/commitdiff
don't log every strange packet coming to the UDP port
authorMichael Tokarev <mjt@corpit.ru>
Thu, 21 May 2009 21:10:16 +0000 (01:10 +0400)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 24 May 2009 15:28:24 +0000 (17:28 +0200)
it's a sure way to fill up syslog.  Only log those if
debug level is up to PROTOCOL

src/net_packet.c

index de6ae550ed24ddeeede7cb7c87a58b36f2d8c27a..a5fede148ad2b0342bbdaf367804a8afaa9bb55c 100644 (file)
@@ -545,12 +545,14 @@ void handle_incoming_vpn_data(int sock)
                n = try_harder(&from, &pkt);
                if(n)
                        update_node_udp(n, &from);
-               else {
+               else ifdebug(PROTOCOL) {
                        hostname = sockaddr2hostname(&from);
                        logger(LOG_WARNING, _("Received UDP packet from unknown source %s"), hostname);
                        free(hostname);
                        return;
                }
+               else
+                       return;
        }
 
        receive_udppacket(n, &pkt);