}
if(n->mtuprobes == 31) {
+ if(!n->minmtu && n->status.want_udp) {
+ /* Send a dummy ANS_KEY to try to update the reflexive UDP address */
+ send_request(mesh, n->nexthop->connection, NULL, "%d %s %s . -1 -1 -1 0", ANS_KEY, mesh->self->name, n->name);
+ n->status.want_udp = false;
+ }
+
timeout = mesh->dev_class_traits[n->devclass].pinginterval;
goto end;
} else if(n->mtuprobes == 32) {
n->out_packets++;
n->out_bytes += packet->len;
+ n->status.want_udp = true;
send_sptps_packet(mesh, n, packet);
return;
uint16_t destroyed: 1; /* 1 if the node is being destroyed, deallocate channels when any callback is triggered */
uint16_t duplicate: 1; /* 1 if the node is duplicate, ie. multiple nodes using the same Name are online */
uint16_t dirty: 1; /* 1 if the configuration of the node is dirty and needs to be written out */
+ uint16_t want_udp: 1; /* 1 if we want working UDP because we have data to send */
} node_status_t;
typedef struct node_t {
return send_request(mesh, to->nexthop->connection, NULL, "%s", request);
}
- /* Don't use key material until every check has passed. */
- from->status.validkey = false;
+ /* Process SPTPS data if present */
- /* Compression is not supported. */
- if(compression != 0) {
- logger(mesh, MESHLINK_ERROR, "Node %s uses bogus compression level!", from->name);
- return true;
- }
+ if(*key != '.') {
+ /* Don't use key material until every check has passed. */
+ from->status.validkey = false;
- /* SPTPS or old-style key exchange? */
+ /* Compression is not supported. */
+ if(compression != 0) {
+ logger(mesh, MESHLINK_ERROR, "Node %s uses bogus compression level!", from->name);
+ return true;
+ }
- char buf[strlen(key)];
- int len = b64decode(key, buf, strlen(key));
+ char buf[strlen(key)];
+ int len = b64decode(key, buf, strlen(key));
- if(!len || !sptps_receive_data(&from->sptps, buf, len)) {
- logger(mesh, MESHLINK_ERROR, "Error processing SPTPS data from %s", from->name);
+ if(!len || !sptps_receive_data(&from->sptps, buf, len)) {
+ logger(mesh, MESHLINK_ERROR, "Error processing SPTPS data from %s", from->name);
+ }
}
if(from->status.validkey) {