mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 15:31:26 +12:00
sys_net: SYS_NET_ENETDOWN for offline dns rqsts (#11822)
This commit is contained in:
parent
6783bcd273
commit
895af3c3ab
1 changed files with 2 additions and 2 deletions
|
@ -869,11 +869,11 @@ std::optional<s32> lv2_socket_native::sendto(s32 flags, const std::vector<u8>& b
|
||||||
{
|
{
|
||||||
const s32 ret_analyzer = dnshook.analyze_dns_packet(lv2_id, reinterpret_cast<const u8*>(buf.data()), buf.size());
|
const s32 ret_analyzer = dnshook.analyze_dns_packet(lv2_id, reinterpret_cast<const u8*>(buf.data()), buf.size());
|
||||||
|
|
||||||
// If we're not connected just never send the packet and pretend we did
|
// If we're offline return ENETDOWN for dns requests
|
||||||
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
|
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
|
||||||
if (!nph.get_net_status())
|
if (!nph.get_net_status())
|
||||||
{
|
{
|
||||||
return {::narrow<s32>(buf.size())};
|
return -SYS_NET_ENETDOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the packet is intercepted
|
// Check if the packet is intercepted
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue