diff options
| author | Shulhan <ms@kilabit.info> | 2021-11-11 01:51:28 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-11-11 19:06:24 +0700 |
| commit | 61a05a6efaed33e23e0237deef9a0ba778b80f18 (patch) | |
| tree | f8f8ccc986014f2896161c1a96ba8f01346d5177 /lib | |
| parent | 5e07be2c3ad34ce8b025e04958aff28f621b9b23 (diff) | |
| download | pakakeh.go-61a05a6efaed33e23e0237deef9a0ba778b80f18.tar.xz | |
lib/dns: do not cache truncated answer
Previously only answer with non-zero response code is ignored.
This changes ignore also answer where response header is truncated.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/dns/server.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/dns/server.go b/lib/dns/server.go index 167feb3d..49a9ec11 100644 --- a/lib/dns/server.go +++ b/lib/dns/server.go @@ -766,6 +766,10 @@ func (srv *Server) processResponse(req *request, res *Message) { res.Header.ID, res.Question.String()) return } + if res.Header.IsTC { + log.Printf("dns: ! %s TRUNCATED %s", connTypeNames[req.kind], res.Question.String()) + return + } an := newAnswer(res, false) inserted := srv.caches.upsert(an) |
