Dave_the_K wrote:
I'm using the NicheLite networking stack on a Coldfire 52233 processor.
If the subnet mask is set to 0.0.0.0, then everything works fine, I can communicate with the Coldfire by adding a route table entry to the workstation. Coldfire and workstation are on different subnets.
However, if I set any subnetmask, and DHCP is not in use, then the device does not respond to pings or any other requests to it. The ARP who-has/tell communication looks good, but the device won't answer the ping.
It seems like the device just won't respond to activity off its subnet, with a subnetmask set. Other tcp/ip implementations I'm familiar with work fine with just the entry in the workstation routing table. Is there some reason the NicheLite stack is so picky?
When you use DHCP, it automatically gets a default gateway. Otherwise, there is no default gateway, thus no place to send to destinations outside the subnet.
If you can arrange to set a default gateway any time you set a subnet mask, that should fix it without changing the code. Note that setting an IP via the console interface sets a non-zero mask according to the old class A/B/C rules, but leaves the gateway alone.
Otherwise, you could change the code to recognize default gateway 0 as a special case, and attempt to route through arp anyway instead of dropping the packet (this is all in the arp module).