udhcpd server lease expiration issue

Mahavir Jain mahavir.coep at gmail.com
Mon Jan 5 10:23:03 UTC 2009


Hi,

Comments Inline.


On Sat, Jan 3, 2009 at 8:43 PM, Denys Vlasenko <vda.linux at googlemail.com> wrote:
>
> On Friday 02 January 2009 05:29, Mahavir Jain wrote:
> > Hi,
> >
> > Thanks for making sure that i am not wrong.(Reply)
> >
> > This is my udhcpd.conf file,
> >
> > start 192.168.1.100
> > end 192.168.1.200
> > interface br0
> > opt      lease  86400
> > opt     router  192.168.1.1
> > opt     subnet  255.255.255.0
> > opt     dns     192.168.1.1
> > opt     domain     localdomain
> > max_leases     101
> > lease_file     /var/lib/udhcpd.leases
>
> auto_time is not set, thus udhcpd uses default value of 7200 seconds.

Yes , i was wrong here , i checked with auto_time as 5 seconds , now
DHCP lease does expire upto half of allocated. That is if 100 seconds
then it goes to till 50 seconds if client remains connected.


>
> > In busybox 1.5.0 , i was able to fix it as
> >
> >  printf(" %-15s ", inet_ntoa(addr));
> >  expires = ntohl(lease.expires);
> >  +  expires -= time(0);
>
> What do you plan to achieve by doing it?

It was fix for older busybox 1.5.0 , but now code has been changed ,
so it is meaningless.

>
> >  if (mode == REMAINING) {
> >                         if (!expires)
> >                                 printf("expired\n");
> >
> > Adding same thing to get amount of time remaining in busybox 1.12.0
> > gives me some decrementing count in
> >
> > $ dumpleases -f /var/lib/udhcpd.lease
> >
> > as 4015678 & then it keeps in decrementing . I think its due to format
> > of unix time , i am not able to convert it to actual seconds.
>
> Because the value is bogus now. It does not mean anything.
>
> > Any help regarding this....? As i want to upgrade to latest busybox.
>
> Set auto_time to 30 seconds in config file, and do not do
> that "expires -= time(0)", it isn't right.
> --

For dumpleases -a option , your pacth will work perfectly .

> vda




Thanks a lot..


Mahavir


More information about the busybox mailing list