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 fixes #190

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Network fixes #190

wants to merge 2 commits into from

Conversation

mardy
Copy link
Contributor

@mardy mardy commented Feb 9, 2025

Two commits, I suggest to not squash them.

Having this structure being 16 bytes long causes net_sendto not to work; setting it to 8 bytes means that we can get rid of a few magic numbers in libogc's code (which actually show that the structure is meant to be 8 bytes only).

Changes have been tested on both a real Wii and on Dolphin, using the sockettest and udptest from wii-examples.

mardy added 2 commits February 9, 2025 17:23
This very same check is present a couple of lines below, so there's no
point in repeating it. In any case the check must be done after checking
that the pointer is not NULL (which is done below).
Having this structure being 16 bytes long causes net_sendto not to work;
setting it to 8 bytes means that we can get rid of a few magic numbers
in libogc's code (which actually show that the structure is meant to be
8 bytes only).

Changes have been tested on both a real Wii and on Dolphin, using the
sockettest and udptest from wii-examples.

Fixes: devkitPro#189
@DacoTaco
Copy link
Member

DacoTaco commented Feb 9, 2025

mind updating the lwip stuff too, if needed?

@mardy
Copy link
Contributor Author

mardy commented Feb 9, 2025

mind updating the lwip stuff too, if needed?

It's not needed, but I can update that too, if you want. Though I'd rather be conservative and not risk touching it, if it's not broken :-)

@DacoTaco
Copy link
Member

DacoTaco commented Feb 9, 2025

lgtm then.
any opinions @WinterMute ?

@mardy
Copy link
Contributor Author

mardy commented Feb 10, 2025

mind updating the lwip stuff too, if needed?

Actually, after having a closer look at the code, it looks like I involuntarily updated it as well. :-) I thought that the lwip code was using the definitions from the gc/lwip/sockets.h file, but it's actually using the same gc/network.h header that the Wii uses.

And to the best of my knowledge, gc/lwip/sockets.h is completely unused (I run a git grep sockets.h and found no result). If you agree, I can make another PR removing the file, since it only brings in confusion (or even add a commit to this PR).

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

Successfully merging this pull request may close these issues.

2 participants