for splay_each(node_t, n, &node_tree) {
if(n == myself || n->connection || !(n->status.has_address || n->status.reachable)) {
for splay_each(node_t, n, &node_tree) {
if(n == myself || n->connection || !(n->status.has_address || n->status.reachable)) {
for splay_each(node_t, n, &node_tree) {
if(n == myself || n->connection || !(n->status.has_address || n->status.reachable)) {
for splay_each(node_t, n, &node_tree) {
if(n == myself || n->connection || !(n->status.has_address || n->status.reachable)) {
* 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. */
static void drop_superfluous_outgoing_connection() {
/* Choose a random outgoing connection to a node that has at least one other connection. */
static void drop_superfluous_outgoing_connection() {
/* Choose a random outgoing connection to a node that has at least one other connection. */
for list_each(connection_t, c, &connection_list) {
if(!c->edge || !c->outgoing || !c->node || c->node->edge_tree.count < 2) {
for list_each(connection_t, c, &connection_list) {
if(!c->edge || !c->outgoing || !c->node || c->node->edge_tree.count < 2) {
for list_each(connection_t, c, &connection_list) {
if(!c->edge || !c->outgoing || !c->node || c->node->edge_tree.count < 2) {
for list_each(connection_t, c, &connection_list) {
if(!c->edge || !c->outgoing || !c->node || c->node->edge_tree.count < 2) {