[syslinux] truncated files on write with tftpd-hpa

H. Peter Anvin hpa at zytor.com
Thu May 1 16:04:45 PDT 2003


Alan Sundell wrote:
> 
> Does that sound reasonable, or does anyone have some other explanation?
> Has anyone seen this behavior before?
> 
> It seems to me like the problems I'm seeing could be avoided on the
> tftpd side in one (or both) of two ways:
>     1) not truncating the file until the first data packet is received
>     2) not responding to a second WRQ with the same host+port within some
> period (since the TIDs should be chosen such that they are unlikely to
> repeat, if I read the RFCs correctly).
> 
> But, like I said, I'm no TFTP or tftp-hpa expert, which I why I'm
> emailing the SYSLINUX list.
> 

It's entirely reasonable.  Since two sessions have been opened, you have
effectively a two-writer problem.

The "connection refused" is probably the best bet for solving this,
since the natural mutex is the kernel lock on the port number.  This
would mean we shouldn't open the file until we have connect()ed, which
is probably correct anyway; if nothing else we still need to send back
the error code, so we need to connect() no matter what.

	-hpa




More information about the Syslinux mailing list