diff options
author | 2023-08-14 20:33:37 -0400 | |
---|---|---|
committer | 2023-08-14 20:33:37 -0400 | |
commit | 678d0333af3398d1177a95ee750f61521c2e1d87 (patch) | |
tree | f8cd4b04e7d3c8ca4426768f1549a0a1120591e2 /plugin | |
parent | 90d55611a2efbcbdd58c63ecae9f979af4668587 (diff) | |
download | coredns-678d0333af3398d1177a95ee750f61521c2e1d87.tar.gz coredns-678d0333af3398d1177a95ee750f61521c2e1d87.tar.zst coredns-678d0333af3398d1177a95ee750f61521c2e1d87.zip |
Revert "plugin/forward: Continue waiting after receiving malformed responses (#6014)" (#6270)
This reverts commit 604a902e2c7e0317aecaa3666124079c75a31573.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/pkg/proxy/connect.go | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/plugin/pkg/proxy/connect.go b/plugin/pkg/proxy/connect.go index d799df498..f1cc481a1 100644 --- a/plugin/pkg/proxy/connect.go +++ b/plugin/pkg/proxy/connect.go @@ -7,7 +7,6 @@ package proxy import ( "context" "io" - "net" "strconv" "sync/atomic" "time" @@ -118,20 +117,11 @@ func (p *Proxy) Connect(ctx context.Context, state request.Request, opts Options for { ret, err = pc.c.ReadMsg() if err != nil { - // For UDP, if the error is not a network error keep waiting for a valid response to prevent malformed - // spoofs from blocking the upstream response. - // In the case this is a legitimate malformed response from the upstream, this will result in a timeout. - if proto == "udp" { - if _, ok := err.(net.Error); !ok { - continue - } - } - pc.c.Close() // connection closed by peer, close the persistent connection + pc.c.Close() // not giving it back if err == io.EOF && cached { return nil, ErrCachedClosed } - - // recover the origin Id after upstream. + // recovery the origin Id after upstream. if ret != nil { ret.Id = originId } |