From: Alan T. DeKok Date: Sun, 6 Aug 2017 10:13:43 +0000 (+0200) Subject: update time after removing connection from the heap X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f517e9a0f976aad7854e0591ff657e5dfd0686e;p=thirdparty%2Ffreeradius-server.git update time after removing connection from the heap --- diff --git a/src/modules/rlm_radius/rlm_radius_udp.c b/src/modules/rlm_radius/rlm_radius_udp.c index e56cf71e7a6..b8258cc88b1 100644 --- a/src/modules/rlm_radius/rlm_radius_udp.c +++ b/src/modules/rlm_radius/rlm_radius_udp.c @@ -355,13 +355,6 @@ static void conn_read(fr_event_list_t *el, int fd, UNUSED int flags, void *uctx) } } - /* - * Track the Most Recently Started with reply - */ - if (timercmp(&rr->start, &c->mrs_time, >)) { - c->mrs_time = rr->start; - } - switch (c->state) { default: rad_assert(0 == 1); @@ -370,16 +363,23 @@ static void conn_read(fr_event_list_t *el, int fd, UNUSED int flags, void *uctx) case CONN_FULL: fr_dlist_remove(&c->entry); rad_assert(c->id->num_free > 0); - (void) fr_heap_insert(c->thread->active, c); - c->state = CONN_ACTIVE; break; case CONN_ACTIVE: (void) fr_heap_extract(c->thread->active, c); - (void) fr_heap_insert(c->thread->active, c); break; } + /* + * Track the Most Recently Started with reply + */ + if (timercmp(&rr->start, &c->mrs_time, >)) { + c->mrs_time = rr->start; + } + + (void) fr_heap_insert(c->thread->active, c); + c->state = CONN_ACTIVE; + // @todo - set rcode based on ACK or NAK link->rcode = RLM_MODULE_OK;