Fix initialisation of packet decryption context broken by commit 3308d13e7e3bf20cfeaf...
[tinc] / src / net_packet.c
index 1730023..0126d41 100644 (file)
@@ -54,7 +54,6 @@
 
 int keylifetime = 0;
 int keyexpires = 0;
-EVP_CIPHER_CTX packet_ctx;
 static char lzo_wrkmem[LZO1X_999_MEM_COMPRESS > LZO1X_1_MEM_COMPRESS ? LZO1X_999_MEM_COMPRESS : LZO1X_1_MEM_COMPRESS];
 
 static void send_udppacket(node_t *, vpn_packet_t *);
@@ -342,7 +341,7 @@ static void send_udppacket(node_t *n, vpn_packet_t *origpkt)
                return;
        }
 
-       if(!n->minmtu && (inpkt->data[12] | inpkt->data[13])) {
+       if(n->options & OPTION_PMTU_DISCOVERY && !n->minmtu && (inpkt->data[12] | inpkt->data[13])) {
                ifdebug(TRAFFIC) logger(LOG_INFO,
                                _("No minimum MTU established yet for %s (%s), forwarding via TCP"),
                                n->name, n->hostname);
@@ -545,12 +544,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);