X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprotocol_key.c;h=1d471c80084181817ab3529821f9fac5675676f9;hp=e2e4be5db8ec8e90b0e61006c19d4d6a28c8b872;hb=ae5249610954af17c68c547bb1b45ad286ad647e;hpb=f99661a4ca5bacff47239ce7978b9c9948917c54 diff --git a/src/protocol_key.c b/src/protocol_key.c index e2e4be5d..1d471c80 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-2010 Guus Sliepen + 2000-2011 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);