]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
update time after removing connection from the heap
authorAlan T. DeKok <aland@freeradius.org>
Sun, 6 Aug 2017 10:13:43 +0000 (12:13 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 6 Aug 2017 10:13:43 +0000 (12:13 +0200)
src/modules/rlm_radius/rlm_radius_udp.c

index e56cf71e7a6c96e9ca78edb735247f4ada879c75..b8258cc88b1817016349352a0eb89f4195a9d3bc 100644 (file)
@@ -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;