]> git.meshlink.io Git - meshlink/blobdiff - src/net_packet.c
Update android build
[meshlink] / src / net_packet.c
index 7db041b9be15210e5d4566bdf487707510a3b3e9..f0c4e9802bd46649a175995b65c1cd2c264ebc7c 100644 (file)
 
 #include "system.h"
 
-#ifdef HAVE_ZLIB
-#include <zlib.h>
-#endif
-
 #include "conf.h"
 #include "connection.h"
 #include "crypto.h"
@@ -387,9 +383,9 @@ bool send_sptps_data(void *handle, uint8_t type, const void *data, size_t len) {
                   to ensure we get to learn the reflexive UDP address. */
                if(!to->status.validkey) {
                        to->incompression = mesh->self->incompression;
-                       return send_request(mesh, to->nexthop->connection, "%d %s %s %s -1 -1 -1 %d", ANS_KEY, mesh->self->name, to->name, buf, to->incompression);
+                       return send_request(mesh, to->nexthop->connection, NULL, "%d %s %s %s -1 -1 -1 %d", ANS_KEY, mesh->self->name, to->name, buf, to->incompression);
                } else {
-                       return send_request(mesh, to->nexthop->connection, "%d %s %s %d %s", REQ_KEY, mesh->self->name, to->name, REQ_SPTPS, buf);
+                       return send_request(mesh, to->nexthop->connection, NULL, "%d %s %s %d %s", REQ_KEY, mesh->self->name, to->name, REQ_SPTPS, buf);
                }
        }
 
@@ -428,7 +424,7 @@ bool receive_sptps_record(void *handle, uint8_t type, const void *data, uint16_t
 
        if(type == SPTPS_HANDSHAKE) {
                if(!from->status.validkey) {
-                       logger(mesh, MESHLINK_INFO, "SPTPS key exchange with %s succesful", from->name);
+                       logger(mesh, MESHLINK_INFO, "SPTPS key exchange with %s successful", from->name);
                        from->status.validkey = true;
                        from->status.waitingforkey = false;
 
@@ -560,6 +556,8 @@ void handle_incoming_vpn_data(event_loop_t *loop, void *data, int flags) {
        node_t *n;
        int len;
 
+       memset(&from, 0, sizeof(from));
+
        len = recvfrom(ls->udp.fd, pkt.data, MAXSIZE, 0, &from.sa, &fromlen);
 
        if(len <= 0 || len > MAXSIZE) {