projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Nodes use events, so event system should be initialised first and destroyed last.
[tinc]
/
src
/
node.c
diff --git
a/src/node.c
b/src/node.c
index
3519916
..
5dad0aa
100644
(file)
--- a/
src/node.c
+++ b/
src/node.c
@@
-1,7
+1,7
@@
/*
node.c -- node tree management
/*
node.c -- node tree management
- Copyright (C) 2001-200
3 Guus Sliepen <guus@sliepen.eu
.org>,
- 2001-200
3 Ivo Timmermans <ivo@o2w.nl>
+ Copyright (C) 2001-200
6 Guus Sliepen <guus@tinc-vpn
.org>,
+ 2001-200
5 Ivo Timmermans
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
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
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id
: node.c,v 1.1.2.31 2003/12/22 11:04:16 guus Exp
$
+ $Id$
*/
#include "system.h"
*/
#include "system.h"
@@
-93,12
+93,6
@@
void free_node(node_t *n)
if(n->queue)
list_delete_list(n->queue);
if(n->queue)
list_delete_list(n->queue);
- if(n->name)
- free(n->name);
-
- if(n->hostname)
- free(n->hostname);
-
if(n->key)
free(n->key);
if(n->key)
free(n->key);
@@
-112,9
+106,17
@@
void free_node(node_t *n)
EVP_CIPHER_CTX_cleanup(&n->packet_ctx);
EVP_CIPHER_CTX_cleanup(&n->packet_ctx);
- if(n->mtuevent)
+ if(n->mtuevent)
{
event_del(n->mtuevent);
event_del(n->mtuevent);
+ free_event(n->mtuevent);
+ }
+ if(n->hostname)
+ free(n->hostname);
+
+ if(n->name)
+ free(n->name);
+
free(n);
}
free(n);
}
@@
-123,7
+125,6
@@
void node_add(node_t *n)
cp();
avl_insert(node_tree, n);
cp();
avl_insert(node_tree, n);
- avl_insert(node_udp_tree, n);
}
void node_del(node_t *n)
}
void node_del(node_t *n)
@@
-147,7
+148,6
@@
void node_del(node_t *n)
}
avl_delete(node_tree, n);
}
avl_delete(node_tree, n);
- avl_delete(node_udp_tree, n);
}
node_t *lookup_node(char *name)
}
node_t *lookup_node(char *name)