- return send_request(to->nexthop->connection, "%s", request);
- }
-
- /* Check and lookup cipher and digest algorithms */
-
- if(!cipher_open_by_nid(&from->outcipher, cipher)) {
- logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses unknown cipher!", from->name, from->hostname);
- return false;
- }
-
- if(!digest_open_by_nid(&from->outdigest, digest, maclength)) {
- logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses unknown digest!", from->name, from->hostname);
- return false;
- }
-
- if(maclength != digest_length(&from->outdigest)) {
- logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses bogus MAC length!", from->name, from->hostname);
- return false;
- }
-
- if(compression < 0 || compression > 11) {
- logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses bogus compression level!", from->name, from->hostname);
- return true;
- }
-
- from->outcompression = compression;
-
- /* ECDH or old-style key exchange? */
-
- if(experimental && OPTION_VERSION(from->options) >= 2) {
- /* Check if we already have an ECDSA public key for this node. */
-
- if(!node_read_ecdsa_public_key(from)) {
- logger(DEBUG_ALWAYS, LOG_ERR, "No ECDSA public key known for %s (%s), cannot verify ECDH key exchange!", from->name, from->hostname);
- return true;
- }
-
- int siglen = ecdsa_size(&from->ecdsa);
- int keylen = b64decode(key, key, sizeof key);
-
- if(keylen != ECDH_SIZE + siglen) {
- logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses wrong keylength! %d != %d", from->name, from->hostname, keylen, ECDH_SIZE + siglen);
- return true;
- }
-
- if(ECDH_SHARED_SIZE < cipher_keylength(&from->outcipher)) {
- logger(DEBUG_ALWAYS, LOG_ERR, "ECDH key too short for cipher of %s!", from->name);
+ /* Append the known UDP address of the from node, if we have a confirmed one */
+ if(!*address && from->status.udp_confirmed && from->address.sa.sa_family != AF_UNSPEC) {
+ char *reflexive_address, *reflexive_port;
+ logger(mesh, MESHLINK_DEBUG, "Appending reflexive UDP address to ANS_KEY from %s to %s", from->name, to->name);
+ sockaddr2str(&from->address, &reflexive_address, &reflexive_port);
+ send_request(mesh, to->nexthop->connection, NULL, "%s %s %s", request, reflexive_address, reflexive_port);
+ free(reflexive_address);
+ free(reflexive_port);