addDO adds EDNS0 RR if needed and sets DO bit of msg to true. msg must not be nil.
(msg *dns.Msg)
| 665 | // addDO adds EDNS0 RR if needed and sets DO bit of msg to true. msg must not |
| 666 | // be nil. |
| 667 | func (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. |
| 685 | const defaultUDPBufSize = 2048 |
no outgoing calls