mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Let's reject RAW ICMP sockets. Most OS:es won't let you create them anyway.
This commit is contained in:
parent
aa752ade6c
commit
5be4a3036e
1 changed files with 6 additions and 0 deletions
|
@ -425,6 +425,12 @@ static int sceNetInetSocket(int domain, int type, int protocol) {
|
|||
WARN_LOG(Log::sceNet, "UNTESTED sceNetInetSocket(%i, %i, %i) at %08x", domain, type, protocol, currentMIPS->pc);
|
||||
DEBUG_LOG(Log::sceNet, "Socket: Domain = %s, Type = %s, Protocol = %s", inetSocketDomain2str(domain).c_str(), inetSocketType2str(type).c_str(), inetSocketProto2str(protocol).c_str());
|
||||
|
||||
// Reject certain types of socket.
|
||||
if (type == PSP_NET_INET_SOCK_RAW && (protocol == PSP_NET_INET_IPPROTO_ICMP || protocol == PSP_NET_INET_IPPROTO_ICMPV6)) {
|
||||
inetLastErrno = EAFNOSUPPORT;
|
||||
return hleLogWarning(Log::sceNet, -1, "sceNetInetSocket: Rejecting ICMP socket");
|
||||
}
|
||||
|
||||
int socket;
|
||||
InetSocket *inetSock = g_socketManager.CreateSocket(&socket, &inetLastErrno, SocketState::UsedNetInet, domain, type, protocol);
|
||||
if (!inetSock) {
|
||||
|
|
Loading…
Add table
Reference in a new issue