]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
not "do not respond" packets
authorAlan T. DeKok <aland@freeradius.org>
Thu, 22 Jun 2017 20:31:22 +0000 (16:31 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 22 Jun 2017 20:31:22 +0000 (16:31 -0400)
todo - also deal with NAK from the worker

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

index 48e07be27d8dd1229545d2d5d31dec7451052550..c9dffa8471256ef2279fee28cd19d76c8c878a55 100644 (file)
@@ -357,6 +357,14 @@ int fr_radius_tracking_entry_reply(fr_tracking_t *ft, fr_tracking_entry_t *entry
 {
        (void) talloc_get_type_abort(ft, fr_tracking_t);
 
+       /*
+        *      Bad packets are "don't reply"
+        */
+       if (reply_len < 20) {
+               entry->reply_len = 1;
+               return 0;
+       }
+
        entry->reply = talloc_memdup(ft, reply, reply_len);
        entry->reply_len = reply_len;
 
index 65eff21c30862e718ab3b42224b732f50d04632a..8caf6269173de3f9c2550440f2ccdf484578102e 100644 (file)
@@ -241,6 +241,16 @@ static ssize_t mod_read(void const *instance, void **packet_ctx, fr_time_t **rec
 
                        (void) fr_event_timer_insert(inst->el, mod_cleanup_delay, track, &tv, &track->ev);
                }
+
+               /*
+                *      @todo - if track->reply_len == 1, then we are
+                *      INTENTIONALLY not replying.  In that case,
+                *      return 0.  Otherwise, it's a duplicate packet.
+                *      We MAY want to go poke the worker and say it's
+                *      a duplicate packet.  BUT all of that tracking
+                *      is very hard, so we might as well just ignore
+                *      it.
+                */
                return 0;
 
        /*