[BusyBox] DHCP Client fixes

Joshua Jackson busybox at vortech.net
Sat Dec 6 16:52:10 UTC 2003


On Friday 05 December 2003 23:56, Rob Landley wrote:
> On Friday 05 December 2003 13:53, Joshua Jackson wrote:
> > - Switched from using time(0) to calculate the passage of time to using
> > the system uptime counter from the sysinfo() call. This fixes problems
> > when the network is brought up before a timesync or time change is
> > performed that causes a skew in timeout values.
>
> Keep in mind that "uptime" doesn't advance during a software suspend. (2.6
> feature).  Maybe this is the behavior you want, but it does mean that dhcp
> won't automatically request a lease renewal when the system comes back up.
> (You'll have to thump it from a suspend script...)

Resetting the network should (IMO) be part of bringing a system back out of 
suspend. Either way there are time skew problems, but the fact that the 
network needs to be brought up on most systems to hit an NTP host and this 
process is often cron scripted on production systems, using the uptime seems 
the lesser of two evils to me.

> Also, do you handle uptime wrapping on 32 bit systems?  (Is this still an
> issue?)

Well, if you leave your system up for more than 2,147,483,648 seconds (or 
roughly 68 years), it will become a problem. The uptime counter is a signed 
32 bit integer, so at least 31 bits would be significant or 2^31 seconds.

> Rob
> _______________________________________________
> busybox mailing list
> busybox at mail.busybox.net
> http://busybox.net/mailman/listinfo/busybox




More information about the busybox mailing list