]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
clean up the client only if there are no packets for it
authorAlan T. DeKok <aland@freeradius.org>
Wed, 18 Apr 2018 16:19:35 +0000 (12:19 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 18 Apr 2018 16:19:35 +0000 (12:19 -0400)
src/modules/proto_radius/io.c

index 3105dfd3fc4afe973017624ca029af0543428f69..fa639422d93a396e7187bb8481af7a44fb5e6464 100644 (file)
@@ -1554,7 +1554,6 @@ static void packet_expiry_timer(fr_event_list_t *el, struct timeval *now, void *
                struct timeval when;
 
                gettimeofday(&when, NULL);
-
                fr_timeval_add(&when, &when, &inst->cleanup_delay);
                
                if (fr_event_timer_insert(client, el, &track->ev,
@@ -1607,9 +1606,12 @@ static void packet_expiry_timer(fr_event_list_t *el, struct timeval *now, void *
        rad_assert(client->state != PR_CLIENT_PENDING);
 
        /*
-        *      And call the client expiry timer to clean up the client.
+        *      If necessary, call the client expiry timer to clean up
+        *      the client.
         */
-       client_expiry_timer(el, now, client);
+       if (client->packets == 0) {
+               client_expiry_timer(el, now, client);
+       }
 }
 
 static ssize_t mod_write(void *instance, void *packet_ctx,