X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprotocol.c;h=17eb3bdf57b7b05f8c34c3c11b067afa7e12496d;hb=9e96840da810437c45af1c4b139578f7d74d65db;hp=bf54c6a5245289893c88137a3cddfa29ae035c2f;hpb=fcf869cd4250a240ea8d443f70fa373e4fbacf07;p=tinc diff --git a/src/protocol.c b/src/protocol.c index bf54c6a5..17eb3bdf 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: protocol.c,v 1.28.4.91 2001/05/25 11:54:28 guus Exp $ + $Id: protocol.c,v 1.28.4.94 2001/06/09 10:00:34 guus Exp $ */ #include "config.h" @@ -214,6 +214,9 @@ cp /* Copy string to cl */ + if(cl->name) + free(cl->name); + cl->name = xstrdup(name); /* Load information about peer */ @@ -294,6 +297,8 @@ cp if(debug_lvl >= DEBUG_CONNECTIONS) syslog(LOG_NOTICE, _("Connection with %s (%s) activated"), cl->name, cl->hostname); + if(cl->status.outgoing) + seconds_till_retry = 5; /* Reset retry timeout */ cp /* Check some options */ @@ -1098,17 +1103,16 @@ cp This reduces unnecessary key_changed broadcasts. */ - if(mykeyused) + if(from==myself && !mykeyused) + return 0; + + for(node = connection_tree->head; node; node = node->next) { - for(node = connection_tree->head; node; node = node->next) - { - p = (connection_t *)node->data; - if(p != cl && p->status.meta && p->status.active) - if(!(p->options & OPTION_INDIRECT) || from == myself) - send_request(p, "%d %s", KEY_CHANGED, from->name); - } - mykeyused = 0; - } + p = (connection_t *)node->data; + if(p != cl && p->status.meta && p->status.active) + if(!(p->options & OPTION_INDIRECT) || from == myself) + send_request(p, "%d %s", KEY_CHANGED, from->name); + } cp return 0; }