mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-12-13 08:26:36 +00:00
Merge pull request #5007 from jefrsilva/ptpopenfix
Fix for not updating local port information after bind in PtpOpen
This commit is contained in:
commit
7e7d888876
@ -1174,6 +1174,12 @@ int sceNetAdhocPtpOpen(const char *srcmac, int sport, const char *dstmac, int dp
|
||||
|
||||
// Bound Socket to local Port
|
||||
if (bind(tcpsocket, (sockaddr *)&addr, sizeof(addr)) == 0) {
|
||||
// Update sport with the port assigned by bind
|
||||
socklen_t len = sizeof(addr);
|
||||
if (getsockname(tcpsocket, (sockaddr *)&addr, &len) == 0) {
|
||||
sport = ntohs(addr.sin_port);
|
||||
}
|
||||
|
||||
// Allocate Memory
|
||||
SceNetAdhocPtpStat * internal = (SceNetAdhocPtpStat *)malloc(sizeof(SceNetAdhocPtpStat));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user