From: Alan T. DeKok Date: Tue, 10 Oct 2017 15:26:54 +0000 (-0400) Subject: re-initialize fields after re-open X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f92d05420f7cd0f0d551ed4bc842121bd3df8213;p=thirdparty%2Ffreeradius-server.git re-initialize fields after re-open --- diff --git a/src/modules/rlm_radius/rlm_radius_udp.c b/src/modules/rlm_radius/rlm_radius_udp.c index 3f7d2233c34..a4eddcfbdd2 100644 --- a/src/modules/rlm_radius/rlm_radius_udp.c +++ b/src/modules/rlm_radius/rlm_radius_udp.c @@ -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.