/*
net.c -- most of the network code
Copyright (C) 1998-2005 Ivo Timmermans,
- 2000-2017 Guus Sliepen <guus@tinc-vpn.org>
+ 2000-2021 Guus Sliepen <guus@tinc-vpn.org>
2006 Scott Lamb <slamb@slamb.org>
2011 Loïc Grenié <loic.grenie@gmail.com>
#include "system.h"
#include "autoconnect.h"
+#include "conf_net.h"
#include "conf.h"
#include "connection.h"
-#include "device.h"
#include "graph.h"
#include "logger.h"
#include "meta.h"
#include "names.h"
#include "net.h"
-#include "netutl.h"
#include "protocol.h"
#include "subnet.h"
#include "utils.h"
-#include "xalloc.h"
int contradicting_add_edge = 0;
int contradicting_del_edge = 0;
last_periodic_run_time = now;
- for list_each(connection_t, c, connection_list) {
+ for list_each(connection_t, c, &connection_list) {
// control connections (eg. tinc ctl) do not have any timeout
if(c->status.control) {
continue;
exit_configuration(&config_tree);
init_configuration(&config_tree);
- if(!read_server_config()) {
+ if(!read_server_config(config_tree)) {
logger(DEBUG_ALWAYS, LOG_ERR, "Unable to reread configuration file.");
return EINVAL;
}
/* Close connections to hosts that have a changed or deleted host config file */
- for list_each(connection_t, c, connection_list) {
+ for list_each(connection_t, c, &connection_list) {
if(c->status.control) {
continue;
}
void retry(void) {
/* Reset the reconnection timers for all outgoing connections */
- for list_each(outgoing_t, outgoing, outgoing_list) {
+ for list_each(outgoing_t, outgoing, &outgoing_list) {
outgoing->timeout = 0;
if(outgoing->ev.cb)
}
/* Check for outgoing connections that are in progress, and reset their ping timers */
- for list_each(connection_t, c, connection_list) {
+ for list_each(connection_t, c, &connection_list) {
if(c->outgoing && !c->node) {
c->last_ping_time = 0;
}