]> git.saurik.com Git - apple/ipsec.git/blobdiff - ipsec-tools/racoon/throttle.c
ipsec-92.tar.gz
[apple/ipsec.git] / ipsec-tools / racoon / throttle.c
index 73f6b9276f735bf83851d237e8f9e1162f186794..3a5dcb47db1294754c1bade19af7f04c9b0bb90d 100644 (file)
@@ -1,4 +1,6 @@
-/* $Id: throttle.c,v 1.2 2004/11/30 07:40:13 manubsd Exp $ */
+/*     $NetBSD: throttle.c,v 1.4 2006/09/09 16:22:10 manu Exp $        */
+
+/* Id: throttle.c,v 1.5 2006/04/05 20:54:50 manubsd Exp */
 
 /*
  * Copyright (C) 2004 Emmanuel Dreyfus
@@ -49,6 +51,7 @@
 #include <sys/socket.h>
 
 #include <netinet/in.h>
+#include <resolv.h>
 
 #include "vmbuf.h"
 #include "misc.h"
@@ -100,14 +103,15 @@ throttle_host(addr, authfail)
 
        now = time(NULL);
 
+restart:
        TAILQ_FOREACH_REVERSE(te, &throttle_list, throttle_list, next) {
-               /* 
-                * Remove outdated entries 
-                */
+         /*
+          * Remove outdated entries 
+          */
                if (te->penalty < now) {
                        TAILQ_REMOVE(&throttle_list, te, next);
                        racoon_free(te);
-                       continue;
+                       goto restart;
                }
                        
                if (cmpsaddrwop(addr, (struct sockaddr *)&te->host) == 0) {