X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprotocol_key.c;h=e2f67b194e08f5bf895318a3327642fc72e3e2a0;hp=b55e83078a045d975724de39d2d52cc0b57e61bf;hb=8677b839dcd343277e1e519a2d40c8bd0a980dd5;hpb=6685f2c8afc4775c3656dccc5a37286c01c0e854 diff --git a/src/protocol_key.c b/src/protocol_key.c index b55e8307..e2f67b19 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -1,7 +1,7 @@ /* protocol_key.c -- handle the meta-protocol, key exchange Copyright (C) 1999-2005 Ivo Timmermans, - 2000-2012 Guus Sliepen + 2000-2014 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -159,7 +159,7 @@ bool send_ans_key(node_t *to) { // Create a new key if (1 != RAND_bytes((unsigned char *)to->inkey, to->inkeylength)) { int err = ERR_get_error(); - logger(LOG_ERR, "Failed to generate random for key (%s)", "SEND_ANS_KEY", ERR_error_string(err, NULL)); + logger(LOG_ERR, "Failed to generate random for key (%s)", ERR_error_string(err, NULL)); return false; // Do not send insecure keys, let connection attempt fail. } @@ -233,7 +233,7 @@ bool ans_key_h(connection_t *c) { return true; } - if(!*address && from->address.sa.sa_family != AF_UNSPEC) { + if(!*address && from->address.sa.sa_family != AF_UNSPEC && to->minmtu) { char *address, *port; ifdebug(PROTOCOL) logger(LOG_DEBUG, "Appending reflexive UDP address to ANS_KEY from %s to %s", from->name, to->name); sockaddr2str(&from->address, &address, &port);