diff --git a/src/forward.c b/src/forward.c index 8562b2d..fa80251 100644 --- a/src/forward.c +++ b/src/forward.c @@ -244,6 +244,14 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr, if (!daemon->free_frec_src) { query_full(now, NULL); + /* This is tricky; if we're blasted with the same query + over and over, we'll end up taking this path each time + and never resetting until the frec gets deleted by + aging followed by the receipt of a different query. This + is a bit of a DoS vuln. Avoid by explicitly deleting the + frec once it expires. */ + if (difftime(now, forward->time) >= TIMEOUT) + free_frec(forward); goto reply; }