diff --git a/proxy/cache.go b/proxy/cache.go index a998e9771..13f739931 100644 --- a/proxy/cache.go +++ b/proxy/cache.go @@ -104,7 +104,7 @@ func (c *cache) unpackItem(data []byte, req *dns.Msg) (ci *cacheItem, expired bo ttl = uint32(expire - now) } - l := int(binary.BigEndian.Uint32(b.Next(packedMsgLenSz))) + l := int(binary.BigEndian.Uint16(b.Next(packedMsgLenSz))) if l == 0 { return nil, expired }