MCPcopy
hub / github.com/AdguardTeam/dnsproxy / addDO

Method addDO

proxy/proxy.go:667–682  ·  view source on GitHub ↗

addDO adds EDNS0 RR if needed and sets DO bit of msg to true. msg must not be nil.

(msg *dns.Msg)

Source from the content-addressed store, hash-verified

665// addDO adds EDNS0 RR if needed and sets DO bit of msg to true. msg must not
666// be nil.
667func (p *Proxy) addDO(msg *dns.Msg) {
668 if !p.DNSSECEnabled {
669 // Do nothing if DNSSEC is disabled in the proxy.
670 return
671 }
672
673 if o := msg.IsEdns0(); o != nil {
674 if !o.Do() {
675 o.SetDo()
676 }
677
678 return
679 }
680
681 msg.SetEdns0(defaultUDPBufSize, true)
682}
683
684// defaultUDPBufSize defines the default size of UDP buffer for EDNS0 RRs.
685const defaultUDPBufSize = 2048

Callers 2

ResolveMethod · 0.95

Calls

no outgoing calls

Tested by 1