Support ToS/DiffServ priority handling for IPv6 meta and UDP connections.
[tinc] / src / net_setup.c
index fa4e986..765a9eb 100644 (file)
@@ -539,7 +539,12 @@ static bool setup_myself(void) {
 
 #if !defined(SOL_IP) || !defined(IP_TOS)
        if(priorityinheritance)
-               logger(LOG_WARNING, "%s not supported on this platform", "PriorityInheritance");
+               logger(LOG_WARNING, "%s not supported on this platform for IPv4 connection", "PriorityInheritance");
+#endif
+
+#if !defined(IPPROTO_IPV6) || !defined(IPV6_TCLASS)
+       if(priorityinheritance)
+               logger(LOG_WARNING, "%s not supported on this platform for IPv6 connection", "PriorityInheritance");
 #endif
 
        if(!get_config_int(lookup_config(config_tree, "MACExpire"), &macexpire))
@@ -553,6 +558,18 @@ static bool setup_myself(void) {
        } else
                maxtimeout = 900;
 
+       if(get_config_int(lookup_config(config_tree, "MinTimeout"), &mintimeout)) {
+                       if(mintimeout < 0) {
+                               logger(LOG_ERR, "Bogus minimum timeout!");
+                               return false;
+                       }
+                       if(mintimeout > maxtimeout) {
+                               logger(LOG_WARNING, "Minimum timeout (%d s) cannot be larger than maximum timeout (%d s). Correcting !", mintimeout, maxtimeout );
+                               mintimeout=maxtimeout;
+                       }
+               } else
+                       mintimeout = 0;
+
        if(get_config_int(lookup_config(config_tree, "UDPRcvBuf"), &udp_rcvbuf)) {
                if(udp_rcvbuf <= 0) {
                        logger(LOG_ERR, "UDPRcvBuf cannot be negative!");
@@ -713,6 +730,12 @@ static bool setup_myself(void) {
        xasprintf(&envp[2], "INTERFACE=%s", iface ? : "");
        xasprintf(&envp[3], "NAME=%s", myself->name);
 
+#ifdef HAVE_MINGW
+       Sleep(1000);
+#endif
+#ifdef HAVE_CYGWIN
+       sleep(1);
+#endif
        execute_script("tinc-up", envp);
 
        for(i = 0; i < 4; i++)