]> git.meshlink.io Git - meshlink/blobdiff - src/net_packet.c
Move pinginterval pingtimeout and maxtimeout to mesh
[meshlink] / src / net_packet.c
index a8c8b03619924bfe0e18e493c8e8f221a6891942..281fd973c7fddba951bb12f1ddb0b1ea996e4427 100644 (file)
 #include <zlib.h>
 #endif
 
-#include "cipher.h"
 #include "conf.h"
 #include "connection.h"
 #include "crypto.h"
-#include "digest.h"
 #include "graph.h"
 #include "logger.h"
 #include "meshlink_internal.h"
@@ -77,7 +75,7 @@ static void send_mtu_probe_handler(void *data) {
        if(n->mtuprobes > 32) {
                if(!n->minmtu) {
                        n->mtuprobes = 31;
-                       timeout = pinginterval;
+                       timeout = mesh->pinginterval;
                        goto end;
                }
 
@@ -104,10 +102,10 @@ static void send_mtu_probe_handler(void *data) {
        }
 
        if(n->mtuprobes == 31) {
-               timeout = pinginterval;
+               timeout = mesh->pinginterval;
                goto end;
        } else if(n->mtuprobes == 32) {
-               timeout = pingtimeout;
+               timeout = mesh->pingtimeout;
        }
 
        for(int i = 0; i < 4 + mesh->localdiscovery; i++) {
@@ -127,6 +125,7 @@ static void send_mtu_probe_handler(void *data) {
                        len = 64;
 
                vpn_packet_t packet;
+               packet.probe = true;
                memset(packet.data, 0, 14);
                randomize(packet.data + 14, len - 14);
                packet.len = len;
@@ -651,7 +650,7 @@ void handle_incoming_vpn_data(void *data, int flags) {
                n = try_harder(&from, &pkt);
                if(n)
                        update_node_udp(n, &from);
-               else if(debug_level >= DEBUG_PROTOCOL) {
+               else if(mesh->debug_level >= DEBUG_PROTOCOL) {
                        hostname = sockaddr2hostname(&from);
                        logger(DEBUG_PROTOCOL, LOG_WARNING, "Received UDP packet from unknown source %s", hostname);
                        free(hostname);