X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnode.c;h=80d28d64112c8cc49e1ad3616b4fb06cb432c463;hb=08aabbf9317806bc50a9a6693ca866c8936ce26b;hp=99bbb6db1cf200bca7f940b033e20a6948d4d718;hpb=046158a216e78a0412186ec8463157f6bce45d5d;p=tinc diff --git a/src/node.c b/src/node.c index 99bbb6db..80d28d64 100644 --- a/src/node.c +++ b/src/node.c @@ -1,6 +1,6 @@ /* node.c -- node tree management - Copyright (C) 2001-2006 Guus Sliepen , + Copyright (C) 2001-2009 Guus Sliepen , 2001-2005 Ivo Timmermans This program is free software; you can redistribute it and/or modify @@ -67,13 +67,12 @@ void exit_nodes(void) { } node_t *new_node(void) { - node_t *n = xmalloc_and_zero(sizeof(*n)); + node_t *n = xmalloc_and_zero(sizeof *n); cp(); n->subnet_tree = new_subnet_tree(); n->edge_tree = new_edge_tree(); - n->queue = list_alloc((list_action_t) free); n->mtu = MTU; n->maxmtu = MTU; @@ -83,9 +82,6 @@ node_t *new_node(void) { void free_node(node_t *n) { cp(); - if(n->queue) - list_delete_list(n->queue); - if(n->subnet_tree) free_subnet_tree(n->subnet_tree); @@ -165,11 +161,11 @@ int dump_nodes(struct evbuffer *out) { for(node = node_tree->head; node; node = node->next) { n = node->data; - if(evbuffer_add_printf(out, _(" %s at %s cipher %d digest %d maclength %d compression %d options %lx status %04x nexthop %s via %s pmtu %d (min %d max %d)\n"), + if(evbuffer_add_printf(out, _(" %s at %s cipher %d digest %d maclength %d compression %d options %lx status %04x nexthop %s via %s distance %d pmtu %d (min %d max %d)\n"), n->name, n->hostname, cipher_get_nid(&n->cipher), digest_get_nid(&n->digest), n->maclength, n->compression, n->options, *(uint32_t *)&n->status, n->nexthop ? n->nexthop->name : "-", - n->via ? n->via->name : "-", n->mtu, n->minmtu, n->maxmtu) == -1) + n->via ? n->via->name : "-", n->distance, n->mtu, n->minmtu, n->maxmtu) == -1) return errno; }