]> git.meshlink.io Git - meshlink/blobdiff - src/node.c
Move myself to mesh->self.
[meshlink] / src / node.c
index 171b95fe78544753a43cf633a6a9106e8f9f8aef..83f4a743e92547bd0a582a470647c2995870d1c8 100644 (file)
@@ -1,7 +1,6 @@
 /*
     node.c -- node tree management
-    Copyright (C) 2001-2013 Guus Sliepen <guus@meshlink.io>,
-                  2001-2005 Ivo Timmermans
+    Copyright (C) 2014 Guus Sliepen <guus@meshlink.io>,
 
     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
@@ -22,6 +21,7 @@
 
 #include "hash.h"
 #include "logger.h"
+#include "meshlink_internal.h"
 #include "net.h"
 #include "netutl.h"
 #include "node.h"
@@ -32,8 +32,6 @@
 splay_tree_t *node_tree;
 static hash_t *node_udp_cache;
 
-node_t *myself;
-
 static int node_compare(const node_t *a, const node_t *b) {
        return strcmp(a->name, b->name);
 }
@@ -65,11 +63,6 @@ void free_node(node_t *n) {
 
        sockaddrfree(&n->address);
 
-       cipher_close(n->incipher);
-       digest_close(n->indigest);
-       cipher_close(n->outcipher);
-       digest_close(n->outdigest);
-
        ecdsa_free(n->ecdsa);
        sptps_stop(&n->sptps);
 
@@ -111,8 +104,8 @@ node_t *lookup_node_udp(const sockaddr_t *sa) {
 }
 
 void update_node_udp(node_t *n, const sockaddr_t *sa) {
-       if(n == myself) {
-               logger(DEBUG_ALWAYS, LOG_WARNING, "Trying to update UDP address of myself!");
+       if(n == mesh->self) {
+               logger(DEBUG_ALWAYS, LOG_WARNING, "Trying to update UDP address of mesh->self!");
                return;
        }