[Dnsmasq-discuss] Feature request - customizable timeout and max retransmit count for tftp transfer

Simon Kelley simon at thekelleys.org.uk
Tue Jun 18 21:46:21 BST 2013

On 18/06/13 21:00, Damian Kaczkowski wrote:
> Hello fellow members.
> I have a problem with dnsmasq and its tftp server. I have an embedded
> device which needs very high timeout settings for bootp tftp transfer to
> work. Currently it is not possible to successfully transfer a file to
> this device using dnsmasq. Transfer timeouts before completion. I have
> to use some third party tftp server for transfer to work. I need to set
> --retry-timeout to something like 60 so the server won't consider
> connection as broken too early. After then all works ok.
> It would be nice if dnsmasq team could implement new options for setting
> timeout and max retransmit count for tftp. What do you say? Will this
> idea pass to new versions or it's unlikely to see this implemented in
> future versions?

It's difficult to say: a glance at the man-page shows that dnsmasq 
doesn't have a shortage of options, overall, but we try and restrict 
them to options that will actually be used by more than one person. I 
don't have much of a feeling about if you have a very pathalogical 
client, or this is something that might be more generally useful.
> btw.
> Would someone be so kind and point me out what part of tftp.c should I
> edit to longer the retransmit timeout, please?
> Will changing:
>    transfer->timeout = now + 2;
> to:
>    transfer->timeout = now + 60;
> work?
> I am no coder so I'm not sure what I am doing... ; )

No, that's not the right place to change. The retransmissions/timeouts 
are actually exponential, so the code waits 1 seconds for a reply, 
retransmits, waits 2 seconds, retransmits, waits 4 seconds, retransmits 
and finally waits 8 seconds and then gives up. You can extend that 
sequence by changing the constant in

  else if (++transfer->backoff > 5 && len != 0)

changing 5 to 6 will give you another 16 seconds, to 7 will give you 32 
seconds, etc etc.



More information about the Dnsmasq-discuss mailing list