Re: [Dnsmasq-discuss] Query: DNSMASQ_LEASE_EXPIRES

2016-12-21 Thread Simon Kelley
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256



On 21/12/16 09:30, Nehal J Wani wrote:
> On Thu, Sep 22, 2016 at 3:21 PM, Nehal J Wani
>  wrote:
>> Hi!
>> 
>> According to the man page of dnsmasq, DNSMASQ_LEASE_EXPIRES
>> stores the time of lease expiry and DNSMASQ_TIME_REMAINING stores
>> the number of seconds until expiry and these are passed to the
>> script specified to the option --dhcp-script.
>> 
>> Consider the scenario when the configuration has specified
>> 'infinite' as the value of  for a particular
>> dhcp-range. In this case, the value of DNSMASQ_LEASE_EXPIRES is
>> always 0 and DNSMASQ_TIME_REMAINING is not even present. Is this
>> an expected behaviour?

Yes. 0 is used as a special value which represents "infinite". There's
no sensible value for time_remaining in this case, so that behaviour
seems reasonable too. This doesn;t appear to be documented well in the
man page, patch gratefully accepted :)


>> 
>> Another query: the value of lease-time is stored in an unsigned
>> int while parsing the options and it is different in struct
>> script_data. Is there a specific reason behind choosing different
>> datatypes?

I don't think so. leases longer than 2^31 seconds are pretty unlikely,
so either will do to represent them.

Cheers,

Simon.

>> 
> 
> Ping! :-)
> 
> 
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBCAAGBQJYWxAEAAoJEBXN2mrhkTWidkgP/31BTyP5TW0HDkwLfeb18RYH
enQoT5/7KUUKAxyoJxawTgCbDSl8MVu1jyB+Szu906Re0ErjddqhjXFkj1vC/+DA
LiuYUtJ/xxRIcT9zdxj9NmLNv2xayjX4xf8Z1KKWZvyqnkGQZUSp18PZ2Kg6k/42
3/MNiIIg3Ifs7FUEUaNFL+ShnJi6Ph/4PRuPYoB7oPMK94JV1qYyLse3AM1owouG
1M5bsJU9I8IFhJnZQDrMQNsHKjAtEkL/mbzzrSt45XxVMaOQ53MoZpviCzZT/jRB
rpiKAjCb2C1eto3XuvSHPpdsBlKQMc109l/7eAlti++sbQEXMfzNm5XleI8diMwa
qZGKwmovZcEzgETIipTsGLc7B472VYvzv3Xnz9ISFIyDhnNfbxxMPz+54kKpx/EM
NQEKgMSEh2mWRk3OofU4jEspci0aSFbjFexGOqvIAqvXPmSPcg6TxhmSiDyCBaTV
QVp7il8sPu08k7QnEiehYIJIZ6GZa+a5KKLBrUCgD+pvpg7WrhGhSi0/Fe7Ee+wR
yJiUSjMZNMBMpGoQfjaoxIvt8AX1I8dypMs1nHr7oZvEggjz3F3eqwpOhJrF55LJ
/h1jTaailw0aNfgl3U8YIr2GvAqVxsibj1Z1qk/+TxMKqo3FU9jrSCcXizoJRxV4
XCEKD3Rwj3uqM4+yB4A3
=TUAy
-END PGP SIGNATURE-

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Query: DNSMASQ_LEASE_EXPIRES

2016-12-21 Thread Nehal J Wani
On Thu, Sep 22, 2016 at 3:21 PM, Nehal J Wani  wrote:
> Hi!
>
> According to the man page of dnsmasq, DNSMASQ_LEASE_EXPIRES stores the
> time of lease expiry and DNSMASQ_TIME_REMAINING stores the number of
> seconds until expiry and these are passed to the script specified to
> the option --dhcp-script.
>
> Consider the scenario when the configuration has specified 'infinite'
> as the value of  for a particular dhcp-range. In this
> case, the value of DNSMASQ_LEASE_EXPIRES is always 0 and
> DNSMASQ_TIME_REMAINING is not even present. Is this an expected
> behaviour?
>
> Another query: the value of lease-time is stored in an unsigned int
> while parsing the options and it is different in struct script_data.
> Is there a specific reason behind choosing different datatypes?
>

Ping! :-)


-- 
Nehal J Wani

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Query: DNSMASQ_LEASE_EXPIRES

2016-09-22 Thread Nehal J Wani
Hi!

According to the man page of dnsmasq, DNSMASQ_LEASE_EXPIRES stores the
time of lease expiry and DNSMASQ_TIME_REMAINING stores the number of
seconds until expiry and these are passed to the script specified to
the option --dhcp-script.

Consider the scenario when the configuration has specified 'infinite'
as the value of  for a particular dhcp-range. In this
case, the value of DNSMASQ_LEASE_EXPIRES is always 0 and
DNSMASQ_TIME_REMAINING is not even present. Is this an expected
behaviour?

Another query: the value of lease-time is stored in an unsigned int
while parsing the options and it is different in struct script_data.
Is there a specific reason behind choosing different datatypes?

Cheers!
Nehal J Wani

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss