incrediball wrote on Tuesday, March 17, 2009:
I am now also using the dhcp client in uIP. Did you have problems with the handle_dhcp protothread calling send_discover() at high speed in an endless loop? I found that adding a PT_YIELD(&s.pt) after send_discover() and after send_request() allowed the caller to actually send the packet so that the uip_newdata() in the following PT_WAIT_UNTIL statement actually had some meaning.
Anyway, regarding address renewal:
1. Is it necessary to renew the address if the cable has been disconnected? A lease for the address is granted and so is not the address "ours" until the end of the lease regardless of whether the cable is disconnected or not?
2. Otherwise we only need to handle the lease expiry, which sadly was not implemented. Perhaps it is sufficient to simply replace the:
timer_set (&s.timer, ntohs(s->lease_time)*65536ul + ntohs(s->lease_time));
The following PT_END should then restart the DHCP thread. Does anyone know if this is adequate? I don’t really want to have to wait a week for my IP address to expire, only to find it hasn’t worked…
Sorry, I know talking about DHCP on here is called hijacking but the uIP mailing list is a bit of a joke in my opinion…