The DHCP client on my freescale system (MCF52258 based) works fine to obtain an IP address via the DHCP protocol. I'm using a linksys BESFR41 router for this purpose. When the router is not connected, the DHCP on my board simply times out and reverts to some hardcoded default IP. It was 0.0.0.0 but I now hard-code it to something else.
I wish to use "zero conf networking" protocol (as per RFC 3927) when DHCP times out. There is no such implementation in the freescale OS, and I have not seen it anywhere else on this forum. My application does not need access to the internet, but it does need an IP to operate correctly. Whether the IP is from DHCP or zero-conf does not matter.
So my question: does anyone have a zero conf functionality that I can port to my system?
Thanks.
Ed
It appears that I will implement zeroConf myself. It is not a complex protocol, in fact very simple:
- choose a pseudo-random class B IP address (169.254.xxx.yyy based on the device's MAC)
- send an arp request for that IP
- if no response: the device claims the IP as its own
- if there is an arp response, then repeat the arp request for the next IP
It's a simple protocol, a simple implementation, but does get a bit complicated as you adhere to timers and retries and what-not, as per the protocol (RFC3927).