Emulator Issues #7256
closedMKWii: Dolphin reports wrong local IP
0%
Description
Game Name?
Mario Kart Wii
Game ID?
RMCP01
What's the problem? Describe what went wrong in few words.
Dolphin returns "10.0.1.30" as local IP.
What did you expect to happen instead?
Dolphin returns the local IP of the computer runnning dolphin.
What steps will reproduce the problem?
- Start Wireshark and do a network dump
- Start MKWii, go online and start a race
- Look for the packet containing "localip0"
Dolphin 3.5 and 3.5-367 are old versions of Dolphin that have
known issues and bugs, so don't report issues about them and test the
latest Dolphin version first.
Which versions of Dolphin did you test on?
The latest (4.0)
Does using an older version of Dolphin solve your issue? If yes, which
versions of Dolphin used to work?
No.
What are your PC specifications? (including, but not limited to: Operating
System, CPU and GPU)
Ubuntu 14.04,
Intel-4770K
but this should not care
Are you using the 32 or the 64 bit version of Dolphin?
should not care, 64bit
Is there any other relevant information? (e.g. logs, screenshots,
configuration files)
No.
Updated by florian98.rg over 10 years ago
Seeing how Nintendo WFC games will be shutdown soon anyways, I don't think there's any need to fix this.
Updated by Bach.Florian over 10 years ago
Well, we are deveolping our own MKWii server: http://forum.wii-homebrew.com/board42-kreativitaet/board329-mkw-server-project-english/
And having a working emulator would help testing.
Updated by florian98.rg over 10 years ago
Can't reproduce it anyways. Wireshark always shows me my computer's local IP. Maybe this is Linux/OSX exclusive?
Updated by Bach.Florian over 10 years ago
Source code is not public yet.
Have you looked in the MKWii packet containing the string "localip0"? In the normal Wireshark columns (source and destination) there is the correct IP. But in the packet itself I see 10.0.1.30 on Ubuntu.
Tomorrow I can test with Windows.
Updated by florian98.rg over 10 years ago
Is this still happening on the latest development version?
Updated by tueidj over 10 years ago
The local IP address is hardcoded in Dolphin, not sure how you could be seeing your PC's actual local IP (unless it's a public IP and the game is using a loopback test to determine it).
10.0.1.30: https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp#L1227
192.168.1.150: https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp#L857
Updated by Bach.Florian over 10 years ago
It can't be a public IP. The Wii (Dolphin) writes the local IP into a packet. There is no loopback test. So the only thing why he could see his "real" IP is because he looked at the sender / receiver of the packet and not at the parameter "localip0".
Updated by tueidj over 10 years ago
How does this affect your server implementation, given the remote server shouldn't care what the client's private IP is?
Updated by Bach.Florian over 10 years ago
Well, it does not effect our server, but also the Nintendo server.
This local IP is used if two clients are behind the same router - which happens when testing locally. Then, the packets are directly sent to this IP w/o using NAT Negotiation - and when one of the Clients uses Dolphin, this fails because of the wrong IP.
This would also happen on the official server, but there nobody has found that out again because there nobody plays with one Wii and Dolphin the same time.
But for server testing (without a second player) this is important.
Updated by tueidj over 10 years ago
Sounds like an excellent reason for it to be fixed but I'm glad I don't have to write the code to decide which local IP to use (maybe just return all of them? IOS supports it in theory...)
Updated by degasus over 10 years ago
Oh, so the wii network protocol is completely broken with a second level nat?
iirc there is a way to fetch the local ip of an opened socket, so we could just use the first one.
Updated by Bach.Florian over 10 years ago
The "protocol" is never broken, with two Wiis it works in all cases.
When both Wiis are behind the same NAT, they communicate using their private IPs, for example 192.168.178.22. So, the Wii also sends its local IP to the server that it can send it to the other client. And if Dolphin sends a wrong IP, it won't get packets from the other Wii.
Updated by JMC4789 over 10 years ago
Well, that explains why I never could play Brawl with my Wii when I was testing the branch.
Updated by tueidj over 10 years ago
iirc there is a way to fetch the local ip of an opened socket, so we could just use the first one
The problem is the IOS call used to get the local IP (SOGetInterfaceOpt/option 0x4003) does not take a socket as argument and can be called when there are no active connections. But it is allowed to return a multiple number of IP sets (IP+netmask+broadcast address) so in theory it could return details for each local adapter found in the host (so you don't have to worry about figuring out which interface is used), assuming you're careful enough not to overrun the output buffer.
This also assumes the extra interfaces will show up in the mkwii packets as localip1, localip2 etc...
Updated by parlane about 10 years ago
- Status changed from New to Accepted
This is a valid issue. I'm not personally going to start work on it though, I've accepted it due to it's validity.
Updated by Bach.Florian over 9 years ago
That bug does still exist in 4.0-6759 - is there any chance for this bug to get fixed?
If it's too complicated to make Dolphin recognize the right IP, maybe put a field in the configuration where the user can set his local IP? Dolphin still uses "192.168.1.150" and makes local network play unuseable ...
Updated by leoetlino over 6 years ago
- Status changed from Accepted to Fix pending
Updated by leoetlino over 6 years ago
- Status changed from Fix pending to Fixed
- Fixed in set to 5.0-7106