diff options
author | 2018-08-29 12:26:22 +0100 | |
---|---|---|
committer | 2018-08-29 12:26:22 +0100 | |
commit | ba1efee4f1c2258e43b1bd8035ac6d1208675b95 (patch) | |
tree | 17ec11d7616120357c2828b6374d02ab081c5e42 /plugin/proxy | |
parent | eb51e8bac90fac86d34c9e1cb89b04ea0936b034 (diff) | |
download | coredns-ba1efee4f1c2258e43b1bd8035ac6d1208675b95.tar.gz coredns-ba1efee4f1c2258e43b1bd8035ac6d1208675b95.tar.zst coredns-ba1efee4f1c2258e43b1bd8035ac6d1208675b95.zip |
Default to scrubbing replies in the server (#2012)
Every plugin needs to deal with EDNS0 and should call Scrub to make a
message fit the client's buffer. Move this functionality into the server
and wrapping the ResponseWriter into a ScrubWriter that handles these
bits for us. Result:
Less code and faster, because multiple chained plugins could all be
calling scrub and SizeAndDo - now there is just one place.
Most tests in file/* and dnssec/* needed adjusting because in those unit
tests you don't see OPT RRs anymore. The DNSSEC signer was also looking
at the returned OPT RR to see if it needed to sign - as those are now
added by the server (and thus later), this needed to change slightly.
Scrub itself still exist (for backward compat reasons), but has been
made a noop. Scrub has been renamed to scrub as it should not be used by
external plugins.
Fixes: #2010
Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/proxy')
-rw-r--r-- | plugin/proxy/dns.go | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/plugin/proxy/dns.go b/plugin/proxy/dns.go index d3153bdff..c1aa7f190 100644 --- a/plugin/proxy/dns.go +++ b/plugin/proxy/dns.go @@ -64,10 +64,6 @@ func (d *dnsEx) Exchange(ctx context.Context, addr string, state request.Request return nil, err } reply.Id = state.Req.Id - // When using force_tcp the upstream can send a message that is too big for - // the udp buffer, hence we need to truncate the message to at least make it - // fit the udp buffer. - reply, _ = state.Scrub(reply) return reply, nil } |