Hello,
I'm trying to get the KOS network examples to work properly using DHCPv4 to get the Dreamcast an IP address with a Broadband Adapter. I've managed to get one of my Dreamcasts (the one whose isp-settings network example reports that DHCP is stored in the flashrom) to wait 60 seconds per genwait_wait() in net_dhcp_request(), but it never gets an IPv4 address. The basic networking example, which I've modified slightly to print to the screen--I have to boot via CDs instead of dcload-ip to do all this, and I am using the INIT_NO_DCLOAD init flag--reports UDP send errors and my PC does not show any DHCP request packets being sent over the network. My Router agrees: no DHCPv4 leases are given to the Dreamcast.
What's kind of crazy is that IPv6 works totally fine with router solicitations, and I was able to run and communicate with the IPv6 UDP Echo example no problem (0.0.0.0 was the IPv4 address, though...).
Any ideas where the hangup is? It looks like packets aren't leaving the Dreamcast, but I can't figure out why. Ideally I'd like to be able to override whatever KOS is doing with the flashrom settings and force the machine always use DHCP, but I'm trying to avoid modifying the KOS backend if possible.
KallistiOS IPv4 DHCP Issues
- Moopthehedgehog
- DCEmu Freak
- Posts: 85
- https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
- Joined: Wed Jan 05, 2011 4:25 pm
- Has thanked: 4 times
- Been thanked: 39 times
- Moopthehedgehog
- DCEmu Freak
- Posts: 85
- Joined: Wed Jan 05, 2011 4:25 pm
- Has thanked: 4 times
- Been thanked: 39 times
Re: KallistiOS IPv4 DHCP Issues
Oh, I think I see a problem in KOS. The UDP packet send failed statistic that comes from the basic networking demo gets incremented in only one place, "net_udp_send_raw()," which is an IPv6 function. For some reason IPv4 packets are being processed through "net_udp_send_raw()," which looks like this:
Obviously that's not gonna work!
Edit 1: Nevermind, I jumped to conclusions a bit too soon here. KOS is wrapping up IPv4 in IPv6 and processing it that way... Wow, this is really frustrating to debug...
Spoiler!
Obviously that's not gonna work!
Edit 1: Nevermind, I jumped to conclusions a bit too soon here. KOS is wrapping up IPv4 in IPv6 and processing it that way... Wow, this is really frustrating to debug...
Last edited by Moopthehedgehog on Fri Nov 15, 2019 5:01 pm, edited 2 times in total.
I'm sure Aleron Ives feels weird with his postcount back to <10668
- BlueCrab
- The Crabby Overlord
- Posts: 5652
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 9 times
- Been thanked: 69 times
- Contact:
Re: KallistiOS IPv4 DHCP Issues
Well, that's certainly strange and not behavior that I've seen before with regard to DHCP -- I've seen my router completely ignore the requests when testing (because I sent them too often), but I've never seen the system not send them out.
- Moopthehedgehog
- DCEmu Freak
- Posts: 85
- Joined: Wed Jan 05, 2011 4:25 pm
- Has thanked: 4 times
- Been thanked: 39 times
Re: KallistiOS IPv4 DHCP Issues
Ah! The packets are getting eaten by this check in net_udp.c:
An IP of 0.0.0.0 is valid for the duration of IPv4 DHCP. I see the Nintendo Wii U and a Mac Mini doing it regularly, for example. KOS should not be eating initial DHCPv4 packets like this--when a device is new on the network, it needs to have an initial IP of something to talk to the router. This Wikipedia page shows that 0.0.0.0/8 is reserved for local network communication, and is only valid as a source address.
Update: Commenting out that check works! I get IPv4 DHCP now! Router agrees, I have a DHCP lease assigned to KallistiOS on a Dreamcast.
Now on to what I was really trying to do in the first place...
DCLOAD-IP w/DHCP!!!
Spoiler!
An IP of 0.0.0.0 is valid for the duration of IPv4 DHCP. I see the Nintendo Wii U and a Mac Mini doing it regularly, for example. KOS should not be eating initial DHCPv4 packets like this--when a device is new on the network, it needs to have an initial IP of something to talk to the router. This Wikipedia page shows that 0.0.0.0/8 is reserved for local network communication, and is only valid as a source address.
Update: Commenting out that check works! I get IPv4 DHCP now! Router agrees, I have a DHCP lease assigned to KallistiOS on a Dreamcast.
Now on to what I was really trying to do in the first place...
DCLOAD-IP w/DHCP!!!
- These users thanked the author Moopthehedgehog for the post:
- ThePerfectK
I'm sure Aleron Ives feels weird with his postcount back to <10668
- BlueCrab
- The Crabby Overlord
- Posts: 5652
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 9 times
- Been thanked: 69 times
- Contact:
Re: KallistiOS IPv4 DHCP Issues
Interesting... I'm not sure why it would have ever worked at all if that's how it's broken. Weird... Well, thanks for figuring it out.
I'll rig up a better fix for it than just commenting that out the next time I get a chance to work on things.
I'll rig up a better fix for it than just commenting that out the next time I get a chance to work on things.