[Dnsmasq-discuss] Reg: --dhcp-script option

Simon Kelley simon at thekelleys.org.uk
Mon Dec 16 21:35:37 GMT 2013


On 16/12/13 21:26, Nehal J Wani wrote:
> Is the environment variable DNSMASQ_INTERFACE set when "del" action is
> called? If not, why?

It _may_ be, if the interface associated with the lease is known. That 
information is not stored in the lease file, so restarting dnsmasq will 
lose the knowledge of the interface and DNSMASQ_INTERFACE will not be 
set, unless there's an intervening event that provides the information.

So

<restart dnsmasq>
<renew DHCP lease>
<DHCP lease expires>
<del event sent>

will set DNSMASQ_INTERFACE

but

<stop dnsmasq>
<wait whilst lease expires>
<start dnsmasq>
<dnsmasq notices that lease has expired and sends del event>

won't.

This is also true of many of the other data supplied, eg 
DNSMASQ_VENDOR_CLASS, DNSMASQ_SUPPLIED_HOSTNAME, DNSMASQ_CIRCUIT_ID

Cheers,


Simon.




>
> On 12/17/13, Simon Kelley <simon at thekelleys.org.uk> wrote:
>> On 16/12/13 19:06, Nehal J Wani wrote:
>>> Suppose I am using the script for dnsmasq lease-change hook
>>> ([dnsmasq.git] / contrib / mactable / macscript) and 3 leases have
>>> been handed out for a particular network. Now, if I shutdown the
>>> network and start dnsmasq again after these 3 leases have expired, the
>>> leases file has zero entries, but the "/tmp/dnsmasq-ip-mac.status"
>>> file will have those old entries. How will I clean them up? Will I
>>> have to manually check the timestamps and remove those entries or
>>> dnsmasq provides something that I am missing?
>>>
>>
>> You'll see "del" events for the leases, either when they actually
>> expire, or (if dnsmasq isn't running then) when dnsmasq is started again.
>>
>>
>> Cheers,
>>
>> Simon.
>>
>>
>> _______________________________________________
>> Dnsmasq-discuss mailing list
>> Dnsmasq-discuss at lists.thekelleys.org.uk
>> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>>
>
>




More information about the Dnsmasq-discuss mailing list