control-channel: Resolver filters the Name2IP and DNS groups separately

QA finding 1. `Resolver.addresses` applied one same-subnet check to the
union of the Name2IP mappings and the DNS results. `StartNewTcpClient`
checks each group on its own: the mapped group's failure is a `return`
that skips `Dns.GetHostEntry` entirely (SocketStuff.cs:934-937, 950), so
nothing is dialled for that name that round; the DNS group's failure
(:1037-1040) drops only the DNS addresses, because the mapped ones have
already been dialled (:941). Port that control flow, and document it in
the feature README's Assumptions and docs/protocol.md §10.3 note 6.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
lucioandClaude Opus 5 committed 2026-09-16 01:40:22 -07:00
1 parent 09ca9906e8
commit 43dc25ac71
3 files changed
+46 -20

No files matched your search

+11 -3
View File
@@ -658,13 +658,21 @@ sees them. One subsection per lane, appended, never rewritten.
connection, the counter in practice almost never reaches ten — it is a
same-connection guard, not a same-peer one.
6. **`Name2IP` is concatenated with a policy list, is used in addition to DNS,
and each group is filtered separately.** `Name2IpPolicyList + "\r\n" +
and each group is filtered separately — and a mapped group that fails the
subnet check aborts the whole round.** `Name2IpPolicyList + "\r\n" +
Name2IP` is split on CRLF and then on blanks (`:906-925`); the mapped
addresses get their own same-subnet check and are dialled **before**
`Dns.GetHostEntry` is called at all (`:930-941, 950`), while the DNS group
`Dns.GetHostEntry` is called at all (`:928-944, 950`), while the DNS group
gets the reverse-lookup filter (`:989-1032`) and then its own same-subnet
check (`:1035-1044`). Reverse-lookup validation therefore never applies to a
user-supplied mapping.
user-supplied mapping. The two checks fail differently: the mapped group's
failure is a `return` from `StartNewTcpClient` (`:934-937`) that skips DNS
resolution entirely, so **nothing** is dialled for that name that round; the
DNS group's failure is a `return` reached after the mapped addresses already
went to `StartNewTcpClientThread` (`:941, 1037-1040`), so it drops only the
DNS addresses. Filtering the union of the two groups instead would both
dial out-of-subnet DNS addresses whenever one mapped address matched, and
dial DNS addresses Windows never resolves.
7. **The socket options are per connection, set inside `MainTCPRoutine`.**
`SendBufferSize`/`ReceiveBufferSize = PACKAGE_SIZE * 10000` (320 000),
`NoDelay = true` and `SendTimeout = 500` are applied to the accepted or