X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet_setup.c;h=369c8a40017e14fb60c6d388665a4aaa7ceea073;hp=cbf631f5f211b61ccc545e3676c097a0484689be;hb=95928f7c2910a7da01a89cdc63c86c4d87fac004;hpb=35af4051c3749cd2c2137a7eb57171a1fbb12af7 diff --git a/src/net_setup.c b/src/net_setup.c index cbf631f5..369c8a40 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -218,8 +218,8 @@ bool setup_myself(void) { myself->connection = new_connection(); init_configuration(&myself->connection->config_tree); - xasprintf(&myself->hostname, "MYSELF"); - xasprintf(&myself->connection->hostname, "MYSELF"); + myself->hostname = xstrdup("MYSELF"); + myself->connection->hostname = xstrdup("MYSELF"); myself->connection->options = 0; myself->connection->protocol_version = PROT_CURRENT; @@ -246,8 +246,9 @@ bool setup_myself(void) { if(!read_rsa_private_key()) return false; - if(!get_config_string(lookup_config(myself->connection->config_tree, "Port"), &myport)) - xasprintf(&myport, "655"); + if(!get_config_string(lookup_config(config_tree, "Port"), &myport) + && !get_config_string(lookup_config(myself->connection->config_tree, "Port"), &myport)) + myport = xstrdup("655"); /* Read in all the subnets specified in the host configuration file */ @@ -296,11 +297,10 @@ bool setup_myself(void) { } else routing_mode = RMODE_ROUTER; - // Enable PMTUDiscovery by default if we are in router mode. - - choice = routing_mode == RMODE_ROUTER; + choice = true; get_config_bool(lookup_config(myself->connection->config_tree, "PMTUDiscovery"), &choice); - if(choice) + get_config_bool(lookup_config(config_tree, "PMTUDiscovery"), &choice); + if(choice) myself->options |= OPTION_PMTU_DISCOVERY; get_config_bool(lookup_config(config_tree, "PriorityInheritance"), &priorityinheritance);