X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnode.c;h=23a061016519df93c3aed5e0994082e0dc9c0cf9;hb=3d787920d51a35e74e442c7265be3b13b69ad8e4;hp=7655cae9493706dbb4b374bb9f01481750746a4d;hpb=bcac314fe2d758e85335d499dbb4300bfa8a599e;p=tinc diff --git a/src/node.c b/src/node.c index 7655cae9..23a06101 100644 --- a/src/node.c +++ b/src/node.c @@ -89,6 +89,10 @@ node_t *new_node(void) { } void free_node(node_t *n) { + if(!n) { + return; + } + splay_empty_tree(&n->subnet_tree); splay_empty_tree(&n->edge_tree); @@ -202,14 +206,14 @@ bool dump_nodes(connection_t *c) { } id[sizeof(id) - 1] = 0; - send_request(c, "%d %d %s %s %s %d %d %zu %d %x %x %s %s %d %d %d %d %ld %d %"PRIu64" %"PRIu64" %"PRIu64" %"PRIu64, CONTROL, REQ_DUMP_NODES, + send_request(c, "%d %d %s %s %s %d %d %lu %d %x %x %s %s %d %d %d %d %ld %d %"PRIu64" %"PRIu64" %"PRIu64" %"PRIu64, CONTROL, REQ_DUMP_NODES, n->name, id, n->hostname ? n->hostname : "unknown port unknown", #ifdef DISABLE_LEGACY 0, 0, 0UL, #else - cipher_get_nid(n->outcipher), digest_get_nid(n->outdigest), digest_length(n->outdigest), + cipher_get_nid(n->outcipher), digest_get_nid(n->outdigest), (unsigned long)digest_length(n->outdigest), #endif - n->outcompression, n->options, bitfield_to_int(&n->status, sizeof(n->status)), + n->outcompression, n->options, n->status.value, n->nexthop ? n->nexthop->name : "-", n->via && n->via->name ? n->via->name : "-", n->distance, n->mtu, n->minmtu, n->maxmtu, (long)n->last_state_change, n->udp_ping_rtt, n->in_packets, n->in_bytes, n->out_packets, n->out_bytes);