]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
clean up conflicting packets
authorAlan T. DeKok <aland@freeradius.org>
Sat, 4 Nov 2017 19:01:49 +0000 (15:01 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 4 Nov 2017 19:01:49 +0000 (15:01 -0400)
i.e. toss the new one, but don't send a reply for the old one.

src/lib/io/track.c
src/modules/proto_radius/proto_radius_udp.c

index b4ad8f8ed96e531bf97054a979f3aeebc6329469..8537fa1e90dce18ef3806534d9373b6efb4f1760 100644 (file)
@@ -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).
         */
index 13911697f111792c63762fea72d49f0e8628f891..19ede14a54b3ec7d6b3bcb5e3d36a00bd06ac8fa 100644 (file)
@@ -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;
        }