projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add per-node traffic counters.
[tinc]
/
src
/
node.c
diff --git
a/src/node.c
b/src/node.c
index
0159f9d
..
9281178
100644
(file)
--- a/
src/node.c
+++ b/
src/node.c
@@
-1,6
+1,6
@@
/*
node.c -- node tree management
/*
node.c -- node tree management
- Copyright (C) 2001-20
09
Guus Sliepen <guus@tinc-vpn.org>,
+ Copyright (C) 2001-20
11
Guus Sliepen <guus@tinc-vpn.org>,
2001-2005 Ivo Timmermans
This program is free software; you can redistribute it and/or modify
2001-2005 Ivo Timmermans
This program is free software; you can redistribute it and/or modify
@@
-62,6
+62,7
@@
void exit_nodes(void) {
node_t *new_node(void) {
node_t *n = xmalloc_and_zero(sizeof *n);
node_t *new_node(void) {
node_t *n = xmalloc_and_zero(sizeof *n);
+ if(replaywin) n->late = xmalloc_and_zero(replaywin);
n->subnet_tree = new_subnet_tree();
n->edge_tree = new_edge_tree();
n->mtu = MTU;
n->subnet_tree = new_subnet_tree();
n->edge_tree = new_edge_tree();
n->mtu = MTU;
@@
-92,6
+93,9
@@
void free_node(node_t *n) {
if(n->name)
free(n->name);
if(n->name)
free(n->name);
+ if(n->late)
+ free(n->late);
+
free(n);
}
free(n);
}
@@
-138,6
+142,11
@@
node_t *lookup_node_udp(const sockaddr_t *sa) {
}
void update_node_udp(node_t *n, const sockaddr_t *sa) {
}
void update_node_udp(node_t *n, const sockaddr_t *sa) {
+ if(n == myself) {
+ logger(LOG_WARNING, "Trying to update UDP address of myself!\n");
+ return;
+ }
+
splay_delete(node_udp_tree, n);
if(n->hostname)
splay_delete(node_udp_tree, n);
if(n->hostname)