https://gitlab.synchro.net/main/sbbs/-/commit/7eb6f7302b37d5b88285e5c1
Modified Files:
src/xpdev/netwrap.c
Log Message:
xpdev: detect the IPv6 name servers configured on Windows
getNameServerList() read FIXED_INFO.DnsServerList from GetNetworkParams(), which reports IPv4 name servers only -- its address strings are char[16].
A host whose resolvers are all IPv6 therefore looked like a host with no resolvers at all, leaving system.name_servers empty and breaking dns.js,
and with it ircd.js, which won't start without a name server.
Enumerate with GetAdaptersAddresses(AF_UNSPEC) instead, walking each up, non-loopback adapter's FirstDnsServerAddress. The same server is commonly listed on more than one adapter, so duplicates are dropped. Windows
assigns fec0:0:0:ffff::1/2/3 to any interface that has no IPv6 name server
of its own and they never answer, so they are skipped rather than handed
to a caller as dead sockets. The sizing call is retried, since the adapter
set can grow between it and the call that fills the buffer.
getnameinfo() formats the addresses, so WinSock must be initialized; GetNetworkParams() required nothing of the sort, and without it every
address is dropped and the function returns an empty list rather than an
error. getHostNameByAddr() and isValidAddressString() already bracket
their calls the same way.
Co-Authored-By: Claude Opus 5 (1M context) <
noreply@anthropic.com>
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net