]> git.meshlink.io Git - meshlink/blobdiff - src/net_packet.c
Update UTCP and replace gettimeofday() with clock_gettime().
[meshlink] / src / net_packet.c
index 953887a53d3eed52c741c76712fb7ccffb42f263..7dae0fe0a558c3ac5eed8920de4f00ef290e2f14 100644 (file)
@@ -148,13 +148,13 @@ static void send_mtu_probe_handler(event_loop_t *loop, void *data) {
        n->status.broadcast = false;
 
 end:
-       timeout_set(&mesh->loop, &n->mtutimeout, &(struct timeval) {
+       timeout_set(&mesh->loop, &n->mtutimeout, &(struct timespec) {
                timeout, prng(mesh, TIMER_FUDGE)
        });
 }
 
 void send_mtu_probe(meshlink_handle_t *mesh, node_t *n) {
-       timeout_add(&mesh->loop, &n->mtutimeout, send_mtu_probe_handler, n, &(struct timeval) {
+       timeout_add(&mesh->loop, &n->mtutimeout, send_mtu_probe_handler, n, &(struct timespec) {
                1, 0
        });
        send_mtu_probe_handler(&mesh->loop, n);
@@ -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);