From: Alan T. DeKok Date: Thu, 22 Jun 2017 20:31:22 +0000 (-0400) Subject: not "do not respond" packets X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f56de0fe912a35a679933ddf67204fa38e2df2b8;p=thirdparty%2Ffreeradius-server.git not "do not respond" packets todo - also deal with NAK from the worker --- diff --git a/src/lib/io/track.c b/src/lib/io/track.c index 48e07be27d8..c9dffa84712 100644 --- a/src/lib/io/track.c +++ b/src/lib/io/track.c @@ -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; diff --git a/src/modules/proto_radius/proto_radius_udp.c b/src/modules/proto_radius/proto_radius_udp.c index 65eff21c308..8caf6269173 100644 --- a/src/modules/proto_radius/proto_radius_udp.c +++ b/src/modules/proto_radius/proto_radius_udp.c @@ -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; /*