X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_setup.c;h=73d46c998e2db1d9bf20c6d69289c3ac15405183;hb=01cb1961eac33de9e9d9cecd0910850a2cb549c3;hp=ad9398db4cf157faac427aba4f19cd5375538864;hpb=6123ed30992d671b94fc016660086be6a62a3871;p=tinc diff --git a/src/net_setup.c b/src/net_setup.c index ad9398db..73d46c99 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -637,7 +637,7 @@ bool setup_myself_reloadable(void) { subnet_add(NULL, s); } -#if !defined(IPPROTO_IP) || !defined(IP_TOS) +#if !defined(IP_TOS) if(priorityinheritance) { logger(DEBUG_ALWAYS, LOG_WARNING, "%s not supported on this platform for IPv4 connections", "PriorityInheritance"); @@ -645,7 +645,7 @@ bool setup_myself_reloadable(void) { #endif -#if !defined(IPPROTO_IPV6) || !defined(IPV6_TCLASS) +#if !defined(IPV6_TCLASS) if(priorityinheritance) { logger(DEBUG_ALWAYS, LOG_WARNING, "%s not supported on this platform for IPv6 connections", "PriorityInheritance"); @@ -687,15 +687,8 @@ bool setup_myself_reloadable(void) { keylifetime = 3600; } - config_t *cfg = lookup_config(config_tree, "AutoConnect"); - - if(cfg) { - if(!get_config_bool(cfg, &autoconnect)) { - // Some backwards compatibility with when this option was an int - int val = 0; - get_config_int(cfg, &val); - autoconnect = val; - } + if (!get_config_bool(lookup_config(config_tree, "AutoConnect"), &autoconnect)) { + autoconnect = true; } get_config_bool(lookup_config(config_tree, "DisableBuggyPeers"), &disablebuggypeers); @@ -902,6 +895,7 @@ static bool setup_myself(void) { free(myport); memcpy(&sa, ai->ai_addr, ai->ai_addrlen); + freeaddrinfo(ai); sockaddr2str(&sa, NULL, &myport); } @@ -948,6 +942,16 @@ static bool setup_myself(void) { } } + get_config_int(lookup_config(config_tree, "FWMark"), &fwmark); +#ifndef SO_MARK + + if(fwmark) { + logger(DEBUG_ALWAYS, LOG_ERR, "FWMark not supported on this platform!"); + return false; + } + +#endif + int replaywin_int; if(get_config_int(lookup_config(config_tree, "ReplayWindow"), &replaywin_int)) {