Please consider offering answers and suggestions to help other students!
And if you fix a problem by following a suggestion here,
it would be great if other interested students could see a short
"Great, fixed it!" followup message.
How do I ask a good question?
Displaying selected article
Showing 1 of 503 articles.
Currently 2 other people reading this forum.
I realised that the address printing function was using htons() instead of ntohs(). I changed it, but the ports were still printing unexpected ports. The random ports only appear from outside traffic, and are the same for the duration of the station instance's lifetime. Regardless, the address printing has no effect on the actual sending/receiving, because I just save the address from recvfrom() or getaddrinfo() and reuse that when responses are sent, without changing any data inside. Address printing is just for debugging.
Another thing I found is that my laptop was using Ubuntu 20.04 with WSL version 1, while the desktop PC was using "Ubuntu" on WSL version 2 (no Ubuntu version is specified, but "cat /etc/os-release" tells me it's 22.04). I set up Ubuntu 22.04 with WSL 2 on both the laptop and the desktop, and now neither computers' data goes through to each other. The desktop stations can still talk to each other, and the the desktop's browser can talk to the stations. Same thing for the laptop. But the devices can't communicate with each other in any way.
I'm not sure what to make of this. I think maybe WSL 2 doesn't let traffic through by default, and I have to make a firewall rule? I don't know how to though. Any help is appreciated.
Thanks