]> git.meshlink.io Git - meshlink-tiny/blobdiff - src/net_packet.c
Remove logging when compiled with -DNDEBUG.
[meshlink-tiny] / src / net_packet.c
index b6478e44a7c47f438c7bbfd4f1a419c1ba599ff0..21e164a81135e9f95310bf268d0f5de879bcf059 100644 (file)
@@ -41,9 +41,6 @@ static void receive_packet(meshlink_handle_t *mesh, node_t *n, vpn_packet_t *pac
        if(n->status.blacklisted) {
                logger(mesh, MESHLINK_WARNING, "Dropping packet from blacklisted node %s", n->name);
        } else {
-               n->in_packets++;
-               n->in_bytes += packet->len;
-
                route(mesh, n, packet);
        }
 }
@@ -113,9 +110,9 @@ bool send_sptps_data(void *handle, uint8_t type, const void *data, size_t len) {
        /* If no valid key is known yet, send the packets using ANS_KEY requests,
           to ensure we get to learn the reflexive UDP address. */
        if(!to->status.validkey) {
-               return send_request(mesh, to->nexthop->connection, NULL, "%d %s %s %s -1 -1 -1 %d", ANS_KEY, mesh->self->name, to->name, buf, 0);
+               return send_request(mesh, to->nexthop->connection, "%d %s %s %s -1 -1 -1 %d", ANS_KEY, mesh->self->name, to->name, buf, 0);
        } else {
-               return send_request(mesh, to->nexthop->connection, NULL, "%d %s %s %d %s", REQ_KEY, mesh->self->name, to->name, REQ_SPTPS, buf);
+               return send_request(mesh, to->nexthop->connection, "%d %s %s %d %s", REQ_KEY, mesh->self->name, to->name, REQ_SPTPS, buf);
        }
 }
 
@@ -176,8 +173,6 @@ bool receive_sptps_record(void *handle, uint8_t type, const void *data, uint16_t
 */
 void send_packet(meshlink_handle_t *mesh, node_t *n, vpn_packet_t *packet) {
        if(n == mesh->self) {
-               n->out_packets++;
-               n->out_bytes += packet->len;
                // TODO: send to application
                return;
        }
@@ -189,10 +184,6 @@ void send_packet(meshlink_handle_t *mesh, node_t *n, vpn_packet_t *packet) {
                return;
        }
 
-       n->out_packets++;
-       n->out_bytes += packet->len;
-       n->status.want_udp = true;
-
        send_sptps_packet(mesh, n, packet);
        return;
 }