[Dnsmasq-discuss] Patch: Add --ping-timeout option

aopfer at bennett-electric.com aopfer at bennett-electric.com
Mon May 14 19:04:33 BST 2012


Hello,

This is a patch I wrote for dnsmasq to allow changing the timeout on the
ping
request sent to an IP address to determine whether the address is free
to give
out to a DHCPv4 client. The default value according to the manpage was
1.5
seconds and not changeable. This option lets you set the timeout to a
number of
milliseconds.

I noticed that I had to multiply the given timeout by 2 in order for it
to wait
the correct amount of time. This is reflected in the PING_WAIT constant
as
well, which was set to 3 in order to wait 1.5 seconds. While I believe
my patch
is performing correct behavior, I'd appreciate some explanation as to
why this
is necessary.

I've placed a maxmimum limit of 15 seconds on the timeout. This is
because it
appears that PING_CACHE_TIME must be greater than the timeout. See the
patch
made in dhcp.c for the area where this issue is of concern. 

I have attached the output of `git diff` to this email as a patch. If
this is
not the correct format, please let me know.

Aaron Opfer
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dnsmasq-specify-ping-timeout.patch
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20120514/08e30089/attachment.ksh>


More information about the Dnsmasq-discuss mailing list