projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- Proper initialization of rbltree structures.
[tinc]
/
src
/
subnet.c
diff --git
a/src/subnet.c
b/src/subnet.c
index
b2ced41
..
fcbc45a
100644
(file)
--- a/
src/subnet.c
+++ b/
src/subnet.c
@@
-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: subnet.c,v 1.1.2.1
2 2000/11/20 19:12:17
guus Exp $
+ $Id: subnet.c,v 1.1.2.1
3 2000/11/20 19:41:13
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-37,8
+37,14
@@
/* lists type of subnet */
/* lists type of subnet */
-rbltree_t _subnet_tree = { NULL };
-rbltree_t *subnet_tree = &_subnet_tree;
+rbltree_t *subnet_tree;
+
+void init_subnets(void)
+{
+cp
+ subnet_tree = new_rbltree((rbl_compare_t)subnet_compare, (rbl_action_t)free_subnet);
+cp
+}
/* Subnet comparison */
/* Subnet comparison */
@@
-132,7
+138,7
@@
cp
void subnet_del(subnet_t *subnet)
{
cp
void subnet_del(subnet_t *subnet)
{
cp
-
free_rbl(rbl_unlink(subnet->owner->subnet_tree, subnet)
);
+
rbl_delete(subnet->owner->subnet_tree, subnet
);
rbl_delete(subnet_tree, subnet);
cp
}
rbl_delete(subnet_tree, subnet);
cp
}