mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 06:26:49 +00:00
Add ability to have sockets bind to a local IP address (#12998)
This commit is contained in:
parent
630edde10f
commit
b4757b514d
8 changed files with 55 additions and 2 deletions
|
|
@ -371,6 +371,18 @@ namespace np
|
|||
{
|
||||
dns_ip = conv.s_addr;
|
||||
}
|
||||
|
||||
// Convert bind address
|
||||
conv = {};
|
||||
if (!inet_pton(AF_INET, g_cfg.net.bind_address.to_string().c_str(), &conv))
|
||||
{
|
||||
// Do not set to disconnected on invalid IP just error and continue using default (0.0.0.0)
|
||||
nph_log.error("Provided IP(%s) address for bind is invalid!", g_cfg.net.bind_address.to_string());
|
||||
}
|
||||
else
|
||||
{
|
||||
bind_ip = conv.s_addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -585,6 +597,11 @@ namespace np
|
|||
return dns_ip;
|
||||
}
|
||||
|
||||
u32 np_handler::get_bind_ip() const
|
||||
{
|
||||
return bind_ip;
|
||||
}
|
||||
|
||||
s32 np_handler::get_net_status() const
|
||||
{
|
||||
return is_connected ? CELL_NET_CTL_STATE_IPObtained : CELL_NET_CTL_STATE_Disconnected;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue