Skip to content

Commit

Permalink
Oops forgot to change this also for multiple-instance to work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
anr2me authored and hrydgard committed Jul 19, 2020
1 parent 435ef79 commit 9fae299
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Core/HLE/sceNetAdhoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ static int sceNetAdhocPdpCreate(const char *mac, u32 port, int bufferSize, u32 u
sockaddr_in addr;
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = INADDR_ANY;
if (isLocalServer) {
getLocalIp(&addr);
}

//if (port < 7) addr.sin_port = htons(port + 1341); else // <= 443
addr.sin_port = htons(port + portOffset ); // This not safe in any way...
Expand Down Expand Up @@ -1658,6 +1661,9 @@ static int sceNetAdhocPtpOpen(const char *srcmac, int sport, const char *dstmac,
// addr.sin_len = sizeof(addr);
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = INADDR_ANY;
if (isLocalServer) {
getLocalIp(&addr);
}
addr.sin_port = htons(sport + portOffset);

// Bound Socket to local Port
Expand Down Expand Up @@ -2130,6 +2136,9 @@ static int sceNetAdhocPtpListen(const char *srcmac, int sport, int bufsize, int
sockaddr_in addr;
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = INADDR_ANY;
if (isLocalServer) {
getLocalIp(&addr);
}
addr.sin_port = htons(sport + portOffset);

int iResult = 0;
Expand Down

0 comments on commit 9fae299

Please sign in to comment.