summaryrefslogtreecommitdiff
path: root/toxcore/LAN_discovery.c
diff options
context:
space:
mode:
authorCoren[m] <Break@Ocean>2013-10-24 22:32:28 +0200
committerCoren[m] <Break@Ocean>2013-10-24 22:32:28 +0200
commit0a4c3d7e2e080dafd66d25f7a5806b89f7be1bcf (patch)
tree61409d905b8132bddc9142525cced3368aba0ad8 /toxcore/LAN_discovery.c
parente9d92606d94837ac24e2583cdfd8d313a0fd9338 (diff)
Move unix_time(), id_cpy()/id_eq(), is_timeout() to util.*
unix_time(): - returns local value for current epoch - value is updated explicitly with unix_time_update() called at new_DHT()/doMessenger()/do_DHT() is_timeout(): - uses the local value for current epoch id_cpy()/id_eq() => id_copy()/id_equal(): - centralized duplicate definitions - replaced (most) memcpy()/memcmp() of (*, *, CLIENT_ID_SIZE) with id_copy()/id_equal()
Diffstat (limited to 'toxcore/LAN_discovery.c')
-rw-r--r--toxcore/LAN_discovery.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c
index a4f1ccc2..eb0b95a1 100644
--- a/toxcore/LAN_discovery.c
+++ b/toxcore/LAN_discovery.c
@@ -26,6 +26,7 @@
26#endif 26#endif
27 27
28#include "LAN_discovery.h" 28#include "LAN_discovery.h"
29#include "util.h"
29 30
30#define MAX_INTERFACES 16 31#define MAX_INTERFACES 16
31 32
@@ -214,7 +215,7 @@ int send_LANdiscovery(uint16_t port, Net_Crypto *c)
214{ 215{
215 uint8_t data[crypto_box_PUBLICKEYBYTES + 1]; 216 uint8_t data[crypto_box_PUBLICKEYBYTES + 1];
216 data[0] = NET_PACKET_LAN_DISCOVERY; 217 data[0] = NET_PACKET_LAN_DISCOVERY;
217 memcpy(data + 1, c->self_public_key, crypto_box_PUBLICKEYBYTES); 218 id_copy(data + 1, c->self_public_key);
218 219
219#ifdef __linux 220#ifdef __linux
220 send_broadcasts(c->lossless_udp->net, port, data, 1 + crypto_box_PUBLICKEYBYTES); 221 send_broadcasts(c->lossless_udp->net, port, data, 1 + crypto_box_PUBLICKEYBYTES);