From: Alan T. DeKok Date: Wed, 18 Apr 2018 16:19:35 +0000 (-0400) Subject: clean up the client only if there are no packets for it X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f28685fd19757f41cd6126a56dad2c2fdcce488;p=thirdparty%2Ffreeradius-server.git clean up the client only if there are no packets for it --- diff --git a/src/modules/proto_radius/io.c b/src/modules/proto_radius/io.c index 3105dfd3fc4..fa639422d93 100644 --- a/src/modules/proto_radius/io.c +++ b/src/modules/proto_radius/io.c @@ -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,