Change default lifetime for dynamic clients from 1d to 1h
authorAlan T. DeKok <aland@freeradius.org>
Wed, 30 Jun 2010 14:17:55 +0000 (16:17 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 30 Jun 2010 14:18:31 +0000 (16:18 +0200)
raddb/sites-available/dynamic-clients
src/include/radiusd.h
src/main/client.c
src/main/listen.c

index ab5ae5e..15ed019 100644 (file)
@@ -60,7 +60,7 @@ client dynamic {
        #  If the lifetime is "0", then the dynamic client is never
        #  deleted.  The only way to delete the client is to re-start
        #  the server.
-       lifetime = 86400
+       lifetime = 3600
 }
 
 #
@@ -139,6 +139,8 @@ server dynamic_client_server {
                                FreeRADIUS-Client-Secret = "%{sql: SELECT secret FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"
 
                                FreeRADIUS-Client-NAS-Type = "%{sql: SELECT type FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"
+
+                               FreeRADIUS-Client-Virtual-Server = "%{sql: SELECT server FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"
                        }
 
                }
index 82ea614..20d4ecd 100644 (file)
@@ -140,6 +140,7 @@ typedef struct radclient {
        time_t                  created;
        time_t                  last_new_client;
        char                    *client_server;
+       int                     rate_limit;
 #endif
 
 #ifdef WITH_COA
index 433c5e5..50dde1e 100644 (file)
@@ -557,6 +557,8 @@ static const CONF_PARSER client_config[] = {
          offsetof(RADCLIENT, client_server), 0, NULL },
        { "lifetime",  PW_TYPE_INTEGER,
          offsetof(RADCLIENT, lifetime), 0, NULL },
+       { "rate_limit",  PW_TYPE_BOOLEAN,
+         offsetof(RADCLIENT, rate_limit), 0, NULL },
 #endif
 
 #ifdef WITH_COA
index c28d415..1c36953 100644 (file)
@@ -201,7 +201,8 @@ RADCLIENT *client_listener_find(const rad_listen_t *listener,
                 *      can be defined.
                 */
                rad_assert(client->dynamic == 0);
-       } else {
+
+       } else if (!client->dynamic && client->rate_limit) {
                /*
                 *      The IP is unknown, so we've found an enclosing
                 *      network.  Enable DoS protection.  We only