- return send_request(to->nexthop->connection, "%s", request);
- }
-
- /* SPTPS or old-style key exchange? */
-
- if(experimental && OPTION_VERSION(from->options) >= 2) {
- char buf[strlen(key)];
- int len = b64decode(key, buf, strlen(key));
-
- if(!sptps_receive_data(&from->sptps, buf, len))
- logger(DEBUG_ALWAYS, LOG_ERR, "Error processing SPTPS data from %s (%s)", from->name, from->hostname);
-
- if(from->status.validkey) {
- if(*address && *port) {
- logger(DEBUG_PROTOCOL, LOG_DEBUG, "Using reflexive UDP address from %s: %s port %s", from->name, address, port);
- sockaddr_t sa = str2sockaddr(address, port);
- update_node_udp(from, &sa);
- }
+ if(!to->nexthop || !to->nexthop->connection) {
+ logger(mesh, MESHLINK_WARNING, "Cannot forward ANS_KEY to %s via %s", to->name, to->nexthop ? to->nexthop->name : to->name);
+ return false;
+ }