mirror of
https://github.com/coredns/coredns.git
synced 2026-10-24 11:15:43 -04:00
core/dnsserver: preserve UDP packet destination addresses (#8644)
* core/dnsserver: preserve UDP packet destination addresses Signed-off-by: houyuwushang <180804215+houyuwushang@users.noreply.github.com> * test: modernize reverse UDP reply traversal Signed-off-by: houyuwushang <180804215+houyuwushang@users.noreply.github.com> * test: account for Unix IPv4 source-control capabilities Signed-off-by: houyuwushang <180804215+houyuwushang@users.noreply.github.com> --------- Signed-off-by: houyuwushang <180804215+houyuwushang@users.noreply.github.com>
This commit is contained in:
@@ -200,6 +200,15 @@ func (a *Addr) Unwrap() net.Addr {
|
||||
return a.r
|
||||
}
|
||||
|
||||
// LocalAddr returns the transport packet's destination when the underlying
|
||||
// address carries one. It is independent of the PROXY header's destination.
|
||||
func (a *Addr) LocalAddr() net.Addr {
|
||||
if packet, ok := a.u.(interface{ LocalAddr() net.Addr }); ok {
|
||||
return packet.LocalAddr()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// tlvsFor returns the header's raw TLVs when TLV capture is enabled, else nil.
|
||||
func (c *PacketConn) tlvsFor(header *proxyproto.Header) []byte {
|
||||
if !c.CaptureTLVs {
|
||||
|
||||
Reference in New Issue
Block a user