]> git.meshlink.io Git - meshlink/blobdiff - src/net_socket.c
meshlink_start() now fails when the listening socket could not be opened.
[meshlink] / src / net_socket.c
index d5786e5bc24c15be129f0abe508326ca90b0459a..0639478102df0d6cbe8ff47d69fac7809a611230 100644 (file)
 #define SOL_TCP IPPROTO_TCP
 #endif
 
+#ifndef MSG_NOSIGNAL
+#define MSG_NOSIGNAL 0
+#endif
+
 int addressfamily = AF_UNSPEC;
 int seconds_till_retry = 5;
 int max_connection_burst = 100;
@@ -518,6 +522,7 @@ void setup_outgoing_connection(meshlink_handle_t *mesh, outgoing_t *outgoing) {
                return;
        }
 
+       exit_configuration(&outgoing->config_tree); // discard old configuration if present
        init_configuration(&outgoing->config_tree);
        read_host_config(mesh, outgoing->config_tree, outgoing->name);
        outgoing->cfg = lookup_config(outgoing->config_tree, "Address");