diff options
| author | 2022-10-15 00:23:05 +0100 | |
|---|---|---|
| committer | 2022-10-15 00:23:05 +0100 | |
| commit | 5da227cf8468bf9c7966b896f7c9da7b08e04331 (patch) | |
| tree | fb27969ec633a1b1b03b89f1be9d1b0a66b75259 /src | |
| parent | Fix the default case in GetFirstVisibleChannel and document it. (diff) | |
Document how DNS PTR record lookups work better.
Diffstat (limited to 'src')
| -rw-r--r-- | src/coremods/core_dns.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/coremods/core_dns.cpp b/src/coremods/core_dns.cpp index f3febc36b..94bc549b2 100644 --- a/src/coremods/core_dns.cpp +++ b/src/coremods/core_dns.cpp @@ -307,6 +307,7 @@ class Packet : public Query if (q.name.find(':') != std::string::npos) { + // ::1 => 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa static const char* const hex = "0123456789abcdef"; char reverse_ip[128]; unsigned reverse_ip_count = 0; @@ -324,6 +325,7 @@ class Packet : public Query } else { + // 127.0.0.1 => 1.0.0.127.in-addr.arpa unsigned long forward = ip.in4.sin_addr.s_addr; ip.in4.sin_addr.s_addr = forward << 24 | (forward & 0xFF00) << 8 | (forward & 0xFF0000) >> 8 | forward >> 24; @@ -525,7 +527,8 @@ class MyManager : public Manager, public Timer, public EventHandler return; } - // Update name in the original request so question checking works for PTR queries + // For PTR lookups we rewrite the original name to use the special in-addr.arpa/ip6.arpa + // domains so we need to update the original request so that question checking works. req->question.name = p.question.name; if (SocketEngine::SendTo(this, buffer, len, 0, this->myserver) != len) |
