projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
perform cheap checks first
[tinc]
/
src
/
net_socket.c
diff --git
a/src/net_socket.c
b/src/net_socket.c
index
a696127
..
206321c
100644
(file)
--- a/
src/net_socket.c
+++ b/
src/net_socket.c
@@
-527,7
+527,7
@@
bool do_outgoing_connection(outgoing_t *outgoing) {
int result;
begin:
int result;
begin:
- sa = get_recent_address(outgoing->address_cache);
+ sa = get_recent_address(outgoing->
node->
address_cache);
if(!sa) {
logger(DEBUG_CONNECTIONS, LOG_ERR, "Could not set up a meta connection to %s", outgoing->node->name);
if(!sa) {
logger(DEBUG_CONNECTIONS, LOG_ERR, "Could not set up a meta connection to %s", outgoing->node->name);
@@
-632,6
+632,10
@@
void setup_outgoing_connection(outgoing_t *outgoing, bool verbose) {
node_t *n = outgoing->node;
node_t *n = outgoing->node;
+ if(!n->address_cache) {
+ n->address_cache = open_address_cache(n);
+ }
+
if(n->connection) {
logger(DEBUG_CONNECTIONS, LOG_INFO, "Already connected to %s", n->name);
if(n->connection) {
logger(DEBUG_CONNECTIONS, LOG_INFO, "Already connected to %s", n->name);
@@
-643,10
+647,6
@@
void setup_outgoing_connection(outgoing_t *outgoing, bool verbose) {
}
}
}
}
- if(!outgoing->address_cache) {
- outgoing->address_cache = open_address_cache(n);
- }
-
do_outgoing_connection(outgoing);
return;
do_outgoing_connection(outgoing);
return;
@@
-787,11
+787,6
@@
void handle_new_unix_connection(void *data, int flags) {
static void free_outgoing(outgoing_t *outgoing) {
timeout_del(&outgoing->ev);
static void free_outgoing(outgoing_t *outgoing) {
timeout_del(&outgoing->ev);
-
- if(outgoing->address_cache) {
- close_address_cache(outgoing->address_cache);
- }
-
free(outgoing);
}
free(outgoing);
}