[Dnsmasq-discuss] Wrong dhcp-renewal-time

Andrija Panic andrija.panic at gmail.com
Thu Feb 20 17:36:15 GMT 2020


Thanks Simon,

"infinite" seems to be working fine - I guess something with the year 2038
(?) as it seems that 36250days x 86400sec = ‭3.132.000.000 ‬which is less
than 2^32 (4.294.967.296).

I'll see into incorporating the "infinite" stuff in the code.

Best,
Andrija

On Thu, 20 Feb 2020 at 15:35, Simon Kelley <simon at thekelleys.org.uk> wrote:

>
>
> On 20/02/2020 10:49, Andrija Panic wrote:
> > Hi all,
> >
> > first time posting to this ML.
> >
> > We are using dnsmasq with CloudStack to provide DNS/DHCP services.
> >
> > Recently we've changed the lease duration to 36250 days (98y, i.e.
> > closer to infinity) to make sure that the clients will not renew its
> > lease for a loooong time (for reasons known to us).
> >
> > Now, the lease time is sent fine to the client, but the
> > dhcp-renewal-time and dhcp-rebinding-time are NOT set to 50% (87.5%) of
> > the lease time, but instead to "only" ~650 days, which beats the purpose
> > of us increasing it to 36250 days.
> >
> > Can anyone advise what is happening and if this might be a known issue?
> >
> > Here's an example from the log (dnsmasq version 2.76 on Debian 9)
> >
> > root at r-3199-VM:~# cat /var/log/dnsmasq.log
> >
> > |:|
> > |Feb 20 02:21:17 dnsmasq-dhcp[26752]: 3440196161 sent size: 4 option: 51
> > lease-time 36250d|
> > |Feb 20 02:21:17 dnsmasq-dhcp[26752]: 3440196161 sent size: 4 option: 58
> > T1 649d19h57m19s|
> >
> > Feb 20 02:21:17 dnsmasq-dhcp[26752]: 3440196161 sent size: 4 option: 59
> > T2 649d19h57m20s
> >
> >
> > Thanks,
> >
> > --
> >
> > Andrija Panić
> >
>
> These times are 32-bit values, expressed in seconds, so I suspect that
> your 98 years has overflowed the variable. Either that or the
> end-of-lease time is after 2038, and you're running on a platform with
> 32bt time_t, and have overflowed that.
>
> Instead of messing with very long lease times, why not just set the
> lease time to "infinite", which should solve these problems.
>
> Simon.
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>


-- 

Andrija Panić
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20200220/965667f0/attachment.html>


More information about the Dnsmasq-discuss mailing list