Fix for a DoS attack:
[tinc] / src / net.c
index f8c7306..2d16ae8 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -821,8 +821,8 @@ cp
 
   if(cl->status.outgoing)
     {
 
   if(cl->status.outgoing)
     {
-      alarm(5);
       signal(SIGALRM, sigalrm_handler);
       signal(SIGALRM, sigalrm_handler);
+      alarm(5);
       syslog(LOG_NOTICE, "Try to re-establish outgoing connection in 5 seconds.");
     }
   
       syslog(LOG_NOTICE, "Try to re-establish outgoing connection in 5 seconds.");
     }