plugin/dns64: preserve A fallback response codes (#8619)

* plugin/dns64: preserve fallback response codes

Signed-off-by: xinjun.jiang <xinjun.jiang@daocloud.io>

* plugin/dns64: mark written fallback replies as handled

Signed-off-by: xinjun.jiang <xinjun.jiang@daocloud.io>

---------

Signed-off-by: xinjun.jiang <xinjun.jiang@daocloud.io>
This commit is contained in:
jxj
2026-10-12 12:10:48 +08:00
committed by GitHub
parent 123829d3b3
commit 13c27392fd
3 changed files with 127 additions and 1 deletions

View File

@@ -63,7 +63,7 @@ func (d *DNS64) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
RequestsTranslatedCount.WithLabelValues(metrics.WithServer(ctx)).Inc()
w.WriteMsg(msg)
return msg.Rcode, nil
return dns.RcodeSuccess, nil
}
// Name implements the Handler interface.
@@ -134,6 +134,7 @@ func (d *DNS64) DoDNS64(ctx context.Context, w dns.ResponseWriter, r *dns.Msg, o
func (d *DNS64) Synthesize(origReq, origResponse, resp *dns.Msg) *dns.Msg {
ret := dns.Msg{}
ret.SetReply(origReq)
ret.Rcode = resp.Rcode
// persist truncated state of AAAA response
ret.Truncated = resp.Truncated