]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
re-initialize fields after re-open
authorAlan T. DeKok <aland@freeradius.org>
Tue, 10 Oct 2017 15:26:54 +0000 (11:26 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 10 Oct 2017 15:26:54 +0000 (11:26 -0400)
src/modules/rlm_radius/rlm_radius_udp.c

index 3f7d2233c347131bf69a4a8f7141a916be1b58c8..a4eddcfbdd27bf56f185bfb497762f7fee723699 100644 (file)
@@ -1725,15 +1725,6 @@ static fr_connection_state_t _conn_open(UNUSED fr_event_list_t *el, UNUSED int f
                              fr_box_ipaddr(c->src_ipaddr), c->src_port,
                              fr_box_ipaddr(c->dst_ipaddr), c->dst_port);
 
-       /*
-        *      Connection is "active" now.  i.e. we prefer the newly
-        *      opened connection for sending packets.
-        *
-        *      @todo - connection negotiation via Status-Server
-        */
-       gettimeofday(&c->mrs_time, NULL);
-       c->last_reply = c->mrs_time;
-
        DEBUG("%s - Connection open - %s", c->inst->parent->name, c->name);
 
        /*
@@ -1745,6 +1736,23 @@ static fr_connection_state_t _conn_open(UNUSED fr_event_list_t *el, UNUSED int f
        fr_heap_insert(t->active, c);
        c->state = CONN_ACTIVE;
 
+       /*
+        *      Connection is "active" now.  i.e. we prefer the newly
+        *      opened connection for sending packets.
+        *
+        *      @todo - connection negotiation via Status-Server
+        */
+       gettimeofday(&c->mrs_time, NULL);
+       c->last_reply = c->mrs_time;
+
+       rad_assert(c->zombie_ev == NULL);
+       memset(&c->zombie_start, 0, sizeof(c->zombie_start));
+
+       c->num_requests = 0;
+       c->pending = false;
+       rad_assert(fr_heap_num_elements(c->queued) == 0);
+       FR_DLIST_INIT(c->sent);
+
        /*
         *      Status-Server checks.  Manually build the packet, and
         *      all of it's associated glue.