Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network_wii's if_config() does not populate netmask or gateway #179

Open
emilydaemon opened this issue Sep 6, 2024 · 3 comments
Open

network_wii's if_config() does not populate netmask or gateway #179

emilydaemon opened this issue Sep 6, 2024 · 3 comments

Comments

@emilydaemon
Copy link

Bug Report

What's the issue you encountered?

network_wii's if_config function does not populate netmask or gateway, even though these are accepted as parameters.
I expected them to be populated with subnet mask and default gateway respectively, but the function does not make any changes to them.

How can the issue be reproduced?

  1. Copy the template project folder.
  2. Include the network.h header.
  3. Call if_config() with three separate character arrays (each 16 characters long). The last two parameters should be set to TRUE and 20.
  4. Check the values of each array. The first one is populated as expected (ex. 192.168.68.52), but the second and third arrays are left unchanged.

Environment?

I am using Windows 10 with the supplied msys2 shell, but I do not believe that this is relevant to the problem.

@DacoTaco
Copy link
Member

DacoTaco commented Sep 6, 2024

hey emily!

just took a quick look, and it seems the parameters are unused ( https://github.com/devkitPro/libogc/blob/master/libogc/network_wii.c#L1192 ) ! question is though, are they retrieved in the ios calls...
ill have to dig deeper!

EDIT : look like it'll need to be retrieved from IOS using some calls like it does for the ip :
https://github.com/devkitPro/libogc/blob/master/libogc/network_wii.c#L304

the wiibrew documentation is very... bare for the network stuff. maybe we can find this stuff somewhere else ?

@DacoTaco
Copy link
Member

DacoTaco commented Sep 8, 2024

found something in dolphin. IOS' /dev/net/ip/top device has a IOCTLV called GetInterfaceOption that can retrieve the ip, gateway and subnet mask given the right sub command id. i think our GetHostIp call needs to be replaced with this.
source : https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/Core/IOS/Network/IP/Top.cpp#L981-L991

@DacoTaco
Copy link
Member

DacoTaco commented Sep 9, 2024

image

got the call implemented. need to clean up my code and fix dolphin's implementation of the ioctlv :)
gateway isn't right though, thats the wifi broadcast ip.. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants