X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fnet_packet.c;h=2d3d7c7711c78f0769131c37ef6976e2bbc107ba;hb=0b6635bd9460ba2f9aeafddd2aef79929cd417a1;hp=0510b54be8def584f8b9f33d78329b4d852baaa7;hpb=9ece2f9ded8c65c7f20826f2ec9ae1f0527bdd7c;p=meshlink diff --git a/src/net_packet.c b/src/net_packet.c index 0510b54b..2d3d7c77 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -185,7 +185,14 @@ static void mtu_probe_h(meshlink_handle_t *mesh, node_t *n, vpn_packet_t *packet is possible using the address and socket that the reply packet used. */ - n->status.udp_confirmed = true; + if(!n->status.udp_confirmed) { + char *address, *port; + sockaddr2str(&n->address, &address, &port); + send_request(mesh, n->nexthop->connection, NULL, "%d %s %s . -1 -1 -1 0 %s %s", ANS_KEY, n->name, n->name, address, port); + free(address); + free(port); + n->status.udp_confirmed = true; + } /* If we haven't established the PMTU yet, restart the discovery process. */ @@ -249,7 +256,9 @@ static void receive_udppacket(meshlink_handle_t *mesh, node_t *n, vpn_packet_t * return; } - sptps_receive_data(&n->sptps, inpkt->data, inpkt->len); + if(!sptps_receive_data(&n->sptps, inpkt->data, inpkt->len)) { + logger(mesh, MESHLINK_ERROR, "Could not process SPTPS data from %s: %s", n->name, strerror(errno)); + } } static void send_sptps_packet(meshlink_handle_t *mesh, node_t *n, vpn_packet_t *origpkt) { @@ -550,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);