#include "system.h"
-#ifdef HAVE_ZLIB
-#include <zlib.h>
-#endif
-
#include "conf.h"
#include "connection.h"
#include "crypto.h"
return;
}
- return send_sptps_packet(mesh, n, origpkt);
+ send_sptps_packet(mesh, n, origpkt);
}
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);
}
}
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;
listen_socket_t *ls = data;
vpn_packet_t pkt;
char *hostname;
- sockaddr_t from = {};
+ sockaddr_t from;
socklen_t fromlen = sizeof(from);
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) {