sceNet: Update the connection's DNS server when the infra-dns json arrives

The apctl info copies the AutoDNS server when the connection gets its IP, which
normally happens before netconf has downloaded infra-dns.json, so games that read
the primary DNS server afterwards (to do their own lookups) got an empty string.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-09-25 12:24:02 -06:00
1 parent 6cb7c985bd
commit be30966079
1 file changed
+7
+7
View File
@@ -378,6 +378,13 @@ bool LoadAutoDNS(std::string_view json) {
net::DNSResolveFree(resolved);
}
}
// The connection usually gets its IP (and copies the DNS server) before the json has arrived,
// so a game asking for the DNS server afterwards would otherwise get the empty one.
if (netApctlState == PSP_NET_APCTL_STATE_GOT_IP) {
INFO_LOG(Log::sceNet, "Updating the connection's DNS server to %s", g_infraDNSConfig.dns.c_str());
truncate_cpy(netApctlInfo.primaryDns, sizeof(netApctlInfo.primaryDns), g_infraDNSConfig.dns);
}
return true;
}