From 7647945a702f42d3633d4574fa920ac778d78447 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Mon, 24 Feb 2020 08:44:05 -0500 Subject: [PATCH] drain the socket when we don't care about replies --- src/modules/rlm_radius/rlm_radius_udp.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/rlm_radius/rlm_radius_udp.c b/src/modules/rlm_radius/rlm_radius_udp.c index af41f2fc32ad..9f7aa1b60f4d 100644 --- a/src/modules/rlm_radius/rlm_radius_udp.c +++ b/src/modules/rlm_radius/rlm_radius_udp.c @@ -633,9 +633,17 @@ static void thread_conn_notify(fr_trunk_connection_t *tconn, fr_connection_t *co } switch (notify_on) { + /* + * We may have sent multiple requests to the + * other end, so it might be sending us multiple + * replies. We want to drain the socket, instead + * of letting the packets sit in the UDP receive + * queue. + */ case FR_TRUNK_CONN_EVENT_NONE: - fr_event_fd_delete(el, h->fd, FR_EVENT_FILTER_IO); - return; + read_fn = conn_discard; + write_fn = NULL; + break; case FR_TRUNK_CONN_EVENT_READ: read_fn = conn_readable;