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:
houyuwushang
2026-10-21 11:34:18 +08:00
committed by GitHub
parent e7f823b261
commit 0fe7b08fbb
12 changed files with 1026 additions and 3 deletions

View File

@@ -179,7 +179,7 @@ functions defined below.
.IP \(bu 4
\fB\fCproto() string\fR: protocol used (tcp or udp)
.IP \(bu 4
\fB\fCserver_ip() string\fR: server's IP address; for IPv6 addresses these are enclosed in brackets: \fB\fC[::1]\fR
\fB\fCserver_ip() string\fR: server's destination IP address; IPv6 addresses have no brackets: \fB\fC::1\fR
.IP \(bu 4
\fB\fCserver_port() string\fR : server's port
.IP \(bu 4
@@ -188,6 +188,13 @@ functions defined below.
\fB\fCtype() string\fR: type of the request (A, AAAA, TXT, ...)
.PP
For wildcard UDP listeners, \fB\fCserver_ip()\fR uses the destination address of the individual packet
when the operating system supplies packet information. If that information is unavailable, including
with custom packet listeners that do not expose it, the listening address is used instead.
With \fIproxyproto\fP, this is the transport packet's destination, not the destination claimed in the PROXY header.
.SS "UTILITY FUNCTIONS"
.IP \(bu 4
\fB\fCincidr(ip string, cidr string) bool\fR: returns true if \fIip\fP is within \fIcidr\fP