X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprotocol_key.c;h=1a184fb8f3ba817dccb4553a051361a4bf4b61a9;hp=6ff68d274cacf0eb842e33ace179913a322257b0;hb=afe4bf62eccab76c75e5a661fb2c16f1391a8417;hpb=67766d65f06854ee894d784f638c5c9cd2b50bca diff --git a/src/protocol_key.c b/src/protocol_key.c index 6ff68d27..1a184fb8 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-2011 Guus Sliepen + 2000-2012 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 @@ -34,13 +34,13 @@ #include "utils.h" #include "xalloc.h" -bool mykeyused = false; +static bool mykeyused = false; -void send_key_changed() { +void send_key_changed(void) { avl_node_t *node; connection_t *c; - send_request(broadcast, "%d %x %s", KEY_CHANGED, rand(), myself->name); + send_request(everyone, "%d %x %s", KEY_CHANGED, rand(), myself->name); /* Immediately send new keys to directly connected nodes to keep UDP mappings alive */ @@ -242,8 +242,6 @@ bool ans_key_h(connection_t *c) { /* Update our copy of the origin's packet key */ from->outkey = xrealloc(from->outkey, strlen(key) / 2); - - from->outkey = xstrdup(key); from->outkeylength = strlen(key) / 2; hex2bin(key, from->outkey, from->outkeylength);