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] Windows ipv6 hostname

2016-12-21 Thread Michael Stilkerich

On 2016-12-21 01:26, Markus Hartung wrote:


So I guess the automatic creation of -records doesn't work any
more if I enable privacy extensions.


Your IPv6 host can (and usually does) have several IPv6 addresses at a 
time.
Disabling the use of randomized identifiers ensures that one of those 
addresses is
an EUI-64 address. But the privacy extension are still enabled (this is 
a separate
option, "netsh interface ipv6 set privacy state=disabled"), and your 
host will
additionally have temporary addresses that expire & change over time and 
are used

for outgoing connections.


Thanks for the pointers, now I'm able to correctly get an IPv6-address
that should work with ra-names. However it seems that dnsmasq doesn't
have any hostname in the DHvPv4 lease file.

$ cat /var/lib/misc/dnsmasq.leases
1482365715 3e:XX:XX:XX:XX:02 192.168.1.184 * 01:3e:XX:XX:XX:XX:02
1482334524 00:YY:YY:YY:YY:67 192.168.1.133 hostname *


Well, dnsmasq needs to get the hostname to assign to a machine from 
someplace. I don't know
all the possible places (search the manual page for that), but I can 
think of:


  1) Dnsmasq configuration (dhcp-host options)
  2) /etc/ethers if enabled
  3) suggested with the DHCPv4 request by the client

I think Windows 10 should suggest a hostname (3), at least it seems to 
do for me. I have manually assigned

a hostname on the Windows computer, and dnsmasq knows and assigns it.

-Mike


___
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