/* 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;
}
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;
}
* 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;
}
int count = 0;
for list_each(connection_t, c, &connection_list) {
- if(!c->edge || !c->outgoing || !c->node || c->node->edge_tree->count < 2) {
+ if(!c->edge || !c->outgoing || !c->node || c->node->edge_tree.count < 2) {
continue;
}
int r = rand() % count;
for list_each(connection_t, c, &connection_list) {
- if(!c->edge || !c->outgoing || !c->node || c->node->edge_tree->count < 2) {
+ if(!c->edge || !c->outgoing || !c->node || c->node->edge_tree.count < 2) {
continue;
}