]> git.meshlink.io Git - meshlink/blobdiff - src/net_setup.c
Move pinginterval pingtimeout and maxtimeout to mesh
[meshlink] / src / net_setup.c
index b6d88da3c3c42f9629959cf5cbcd77bede667b3f..e168f6acd4d8a7416378ea0d962821ed730d2060 100644 (file)
 
 #include "system.h"
 
-#include "cipher.h"
 #include "conf.h"
 #include "connection.h"
-#include "digest.h"
 #include "ecdsa.h"
 #include "graph.h"
 #include "logger.h"
@@ -178,7 +176,7 @@ char *get_name(void) {
 bool setup_myself_reloadable(void) {
        mesh->localdiscovery = true;
        keylifetime = 3600; // TODO: check if this can be removed as well
-       maxtimeout = 900;
+       mesh->maxtimeout = 900;
        autoconnect = 3;
        mesh->self->options |= OPTION_PMTU_DISCOVERY;
 
@@ -251,7 +249,7 @@ static bool add_listen_address(char *address, bool bindto) {
                io_add(&mesh->listen_socket[mesh->listen_sockets].tcp, handle_new_meta_connection, &mesh->listen_socket[mesh->listen_sockets], tcp_fd, IO_READ);
                io_add(&mesh->listen_socket[mesh->listen_sockets].udp, handle_incoming_vpn_data, &mesh->listen_socket[mesh->listen_sockets], udp_fd, IO_READ);
 
-               if(debug_level >= DEBUG_CONNECTIONS) {
+               if(mesh->debug_level >= DEBUG_CONNECTIONS) {
                        char *hostname = sockaddr2hostname((sockaddr_t *) aip->ai_addr);
                        logger(DEBUG_CONNECTIONS, LOG_NOTICE, "Listening on %s", hostname);
                        free(hostname);
@@ -372,8 +370,8 @@ bool setup_network(void) {
        init_edges();
        init_requests();
 
-       pinginterval = 60;
-       pingtimeout = 5;
+       mesh->pinginterval = 60;
+       mesh->pingtimeout = 5;
        maxoutbufsize = 10 * MTU;
 
        if(!setup_myself())