projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace pointers to global splay trees with structs.
[tinc]
/
src
/
autoconnect.c
diff --git
a/src/autoconnect.c
b/src/autoconnect.c
index
5651f54
..
a5f433c
100644
(file)
--- a/
src/autoconnect.c
+++ b/
src/autoconnect.c
@@
-28,7
+28,7
@@
static void make_new_connection() {
/* Select a random node we haven't connected to yet. */
int count = 0;
/* Select a random node we haven't connected to yet. */
int count = 0;
- for splay_each(node_t, n, node_tree) {
+ for splay_each(node_t, n,
&
node_tree) {
if(n == myself || n->connection || !(n->status.has_address || n->status.reachable)) {
continue;
}
if(n == myself || n->connection || !(n->status.has_address || n->status.reachable)) {
continue;
}
@@
-42,7
+42,7
@@
static void make_new_connection() {
int r = rand() % count;
int r = rand() % count;
- for splay_each(node_t, n, node_tree) {
+ for splay_each(node_t, n,
&
node_tree) {
if(n == myself || n->connection || !(n->status.has_address || n->status.reachable)) {
continue;
}
if(n == myself || n->connection || !(n->status.has_address || n->status.reachable)) {
continue;
}
@@
-80,9
+80,9
@@
static void connect_to_unreachable() {
* are only a few reachable nodes, and many unreachable ones, we're
* going to try harder to connect to them. */
* are only a few reachable nodes, and many unreachable ones, we're
* going to try harder to connect to them. */
- unsigned int r = rand() % node_tree
->
count;
+ unsigned int r = rand() % node_tree
.
count;
- for splay_each(node_t, n, node_tree) {
+ for splay_each(node_t, n,
&
node_tree) {
if(r--) {
continue;
}
if(r--) {
continue;
}