From: Alan T. DeKok Date: Mon, 2 Oct 2017 13:11:11 +0000 (-0400) Subject: re-initialize the status check packet on connection failed X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9b06065dff6e8757b3992fc676df51860098fe7;p=thirdparty%2Ffreeradius-server.git re-initialize the status check packet on connection failed and remove any pending writes, events, etc. --- diff --git a/src/modules/rlm_radius/rlm_radius_udp.c b/src/modules/rlm_radius/rlm_radius_udp.c index 7b814b7f4f2..636428186c6 100644 --- a/src/modules/rlm_radius/rlm_radius_udp.c +++ b/src/modules/rlm_radius/rlm_radius_udp.c @@ -1551,9 +1551,21 @@ static fr_connection_state_t _conn_failed(int fd, fr_connection_state_t state, v fr_dlist_t *entry; /* - * Stop all Status-Server checks + * Reset the Status-Server checks. */ - if (c->status_u) TALLOC_FREE(c->status_u); + if (c->status_u) { + rlm_radius_udp_request_t *u = c->status_u; + + memset(&u->timer, 0, sizeof(u->timer)); + rad_assert(u->c == c); + + if (u->packet) TALLOC_FREE(u->packet); + u->packet_len = 0; + + if (u->timer.ev) (void) fr_event_timer_delete(c->thread->el, &u->timer.ev); + fr_dlist_remove(&u->entry); + (void) fr_heap_extract(c->queued, c->status_u); + } /* * Delete all timers associated with the connection.