projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update documentation to match tincctl changes
[tinc]
/
src
/
net_setup.c
diff --git
a/src/net_setup.c
b/src/net_setup.c
index
814d698
..
b8fb4f0
100644
(file)
--- a/
src/net_setup.c
+++ b/
src/net_setup.c
@@
-28,9
+28,10
@@
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <openssl/evp.h>
-#include "
avl
_tree.h"
+#include "
splay
_tree.h"
#include "conf.h"
#include "connection.h"
#include "conf.h"
#include "connection.h"
+#include "control.h"
#include "device.h"
#include "graph.h"
#include "logger.h"
#include "device.h"
#include "graph.h"
#include "logger.h"
@@
-46,8
+47,7
@@
char *myport;
static struct event device_ev;
char *myport;
static struct event device_ev;
-bool read_rsa_public_key(connection_t *c)
-{
+bool read_rsa_public_key(connection_t *c) {
FILE *fp;
char *fname;
char *key;
FILE *fp;
char *fname;
char *key;
@@
-147,8
+147,7
@@
bool read_rsa_public_key(connection_t *c)
return false;
}
return false;
}
-bool read_rsa_private_key(void)
-{
+bool read_rsa_private_key(void) {
FILE *fp;
char *fname, *key, *pubkey;
struct stat s;
FILE *fp;
char *fname, *key, *pubkey;
struct stat s;
@@
-241,8
+240,7
@@
void regenerate_key() {
/*
Configure node_t myself and set up the local sockets (listen only)
*/
/*
Configure node_t myself and set up the local sockets (listen only)
*/
-bool setup_myself(void)
-{
+bool setup_myself(void) {
config_t *cfg;
subnet_t *subnet;
char *name, *hostname, *mode, *afname, *cipher, *digest;
config_t *cfg;
subnet_t *subnet;
char *name, *hostname, *mode, *afname, *cipher, *digest;
@@
-528,10
+526,8
@@
bool setup_myself(void)
EV_READ|EV_PERSIST,
handle_new_meta_connection, NULL);
if(event_add(&listen_socket[listen_sockets].ev_tcp, NULL) < 0) {
EV_READ|EV_PERSIST,
handle_new_meta_connection, NULL);
if(event_add(&listen_socket[listen_sockets].ev_tcp, NULL) < 0) {
- logger(LOG_WARNING, _("event_add failed: %s"), strerror(errno));
- close(listen_socket[listen_sockets].tcp);
- close(listen_socket[listen_sockets].udp);
- continue;
+ logger(LOG_EMERG, _("event_add failed: %s"), strerror(errno));
+ abort();
}
event_set(&listen_socket[listen_sockets].ev_udp,
}
event_set(&listen_socket[listen_sockets].ev_udp,
@@
-539,11
+535,8
@@
bool setup_myself(void)
EV_READ|EV_PERSIST,
handle_incoming_vpn_data, NULL);
if(event_add(&listen_socket[listen_sockets].ev_udp, NULL) < 0) {
EV_READ|EV_PERSIST,
handle_incoming_vpn_data, NULL);
if(event_add(&listen_socket[listen_sockets].ev_udp, NULL) < 0) {
- logger(LOG_WARNING, _("event_add failed: %s"), strerror(errno));
- close(listen_socket[listen_sockets].tcp);
- close(listen_socket[listen_sockets].udp);
- event_del(&listen_socket[listen_sockets].ev_tcp);
- continue;
+ logger(LOG_EMERG, _("event_add failed: %s"), strerror(errno));
+ abort();
}
ifdebug(CONNECTIONS) {
}
ifdebug(CONNECTIONS) {
@@
-576,12
+569,9
@@
bool setup_myself(void)
/*
setup all initial network connections
*/
/*
setup all initial network connections
*/
-bool setup_network_connections(void)
-{
+bool setup_network_connections(void) {
cp();
cp();
- now = time(NULL);
-
init_connections();
init_subnets();
init_nodes();
init_connections();
init_subnets();
init_nodes();
@@
-614,9
+604,8
@@
bool setup_network_connections(void)
/*
close all open network connections
*/
/*
close all open network connections
*/
-void close_network_connections(void)
-{
- avl_node_t *node, *next;
+void close_network_connections(void) {
+ splay_node_t *node, *next;
connection_t *c;
char *envp[5];
int i;
connection_t *c;
char *envp[5];
int i;