mirror of
https://github.com/coredns/coredns.git
synced 2026-10-25 11:45: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:
@@ -136,11 +136,16 @@ functions defined below.
|
||||
* `opcode() int`: query OPCODE
|
||||
* `port() string`: client's port
|
||||
* `proto() string`: protocol used (tcp or udp)
|
||||
* `server_ip() string`: server's IP address; for IPv6 addresses these are enclosed in brackets: `[::1]`
|
||||
* `server_ip() string`: server's destination IP address; IPv6 addresses have no brackets: `::1`
|
||||
* `server_port() string` : server's port
|
||||
* `size() int`: request size in bytes
|
||||
* `type() string`: type of the request (A, AAAA, TXT, ...)
|
||||
|
||||
For wildcard UDP listeners, `server_ip()` 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 *proxyproto*, this is the transport packet's destination, not the destination claimed in the PROXY header.
|
||||
|
||||
#### Utility Functions
|
||||
|
||||
* `incidr(ip string, cidr string) bool`: returns true if _ip_ is within _cidr_
|
||||
|
||||
Reference in New Issue
Block a user