From: Alan T. DeKok Date: Sat, 4 Nov 2017 19:01:49 +0000 (-0400) Subject: clean up conflicting packets X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d9d710bda68b696cc9fed732ee8128f6766d2fc;p=thirdparty%2Ffreeradius-server.git clean up conflicting packets i.e. toss the new one, but don't send a reply for the old one. --- diff --git a/src/lib/io/track.c b/src/lib/io/track.c index b4ad8f8ed96..8537fa1e90d 100644 --- a/src/lib/io/track.c +++ b/src/lib/io/track.c @@ -234,6 +234,11 @@ fr_tracking_status_t fr_radius_tracking_entry_insert(fr_tracking_entry_t **p_ent return FR_TRACKING_SAME; } + /* + * Over-write an existing entry. + */ + entry->timestamp = timestamp; + /* * Toss the conflicting packet (for now). */ diff --git a/src/modules/proto_radius/proto_radius_udp.c b/src/modules/proto_radius/proto_radius_udp.c index 13911697f11..19ede14a54b 100644 --- a/src/modules/proto_radius/proto_radius_udp.c +++ b/src/modules/proto_radius/proto_radius_udp.c @@ -408,9 +408,13 @@ static ssize_t mod_write(void *instance, void *packet_ctx, /* * The original packet has changed. Suppress the write, * as the client will never accept the response. + * + * But since we still own the tracking entry, we have to delete it. */ if (track->timestamp != request_time) { DEBUG3("Suppressing reply as we have a newer packet"); + rad_assert(track->ev == NULL); + (void) fr_radius_tracking_entry_delete(inst->ft, track); return buffer_len; }