Check EDNS0 bufsize in Exchange()
In client.Exchange we *did* check for this size, to the same in the function Exchange(). This bug surfaced in issue #184, this sort of fixes it. Closes #184.
This commit is contained in:
parent
841e5ac162
commit
6427527bba
|
@ -55,6 +55,13 @@ func Exchange(m *Msg, a string) (r *Msg, err error) {
|
|||
defer co.Close()
|
||||
co.SetReadDeadline(time.Now().Add(dnsTimeout))
|
||||
co.SetWriteDeadline(time.Now().Add(dnsTimeout))
|
||||
|
||||
opt := m.IsEdns0()
|
||||
// If EDNS0 is used use that for size.
|
||||
if opt != nil && opt.UDPSize() >= MinMsgSize {
|
||||
co.UDPSize = opt.UDPSize()
|
||||
}
|
||||
|
||||
if err = co.WriteMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue