1.7.0-49 beta testing: tftpd of inetutils1.5.6 only transfers file with size no more than 511 byte to tftp client
1. /etc/inetd.conf: ================ tftp dgram udp wait cyg_server /usr/sbin/tftpd tftpd -l /cygdrive/i/data/tftp ================ 2. for a 511 bytes file, tftp works well ================ $ ls -l /cygdrive/i/data/tftp/x -rwxr-xr-x 1 dfhtys None 511 06-11 08:14 /cygdrive/i/data/tftp/x $ tftp 192.168.0.80 tftp> mode binary tftp> verbose Verbose mode on. tftp> trace Packet tracing on. tftp> get x getting from 192.168.0.80:x to x [octet] sent RRQ <file=x, mode=octet> received DATA <block=1, 511 bytes> Received 511 bytes in 0.2 seconds [20440 bits/sec] tftp> quit ================ 3. for the same file modified to 512 bytes, tftp stalls. ================ $ ls -l /cygdrive/i/data/tftp/x -rwxr-xr-x 1 dfhtys None 512 06-11 08:17 /cygdrive/i/data/tftp/x $ tftp 192.168.0.80 tftp> mode binary tftp> verbose Verbose mode on. tftp> trace Packet tracing on. tftp> get x getting from 192.168.0.80:x to x [octet] sent RRQ <file=x, mode=octet> received DATA <block=1, 512 bytes> sent ACK <block=1> sent ACK <block=1> ================ 4. syslog message in var/log/message: ================ Jun 11 08:16:08 t9300d Jun 11 08:16:08 t9300d syslogd: PID 3512: `syslogd' service started Jun 11 08:16:16 t9300d Jun 11 08:16:16 t9300d inetd: PID 2616: `inetd' service started Jun 11 08:16:41 t9300d Jun 11 08:16:41 t9300d tftpd: PID 2728: t9300d: read request for /cygdrive/i/data/tftp/x: success Jun 11 08:16:41 t9300d Jun 11 08:16:41 t9300d tftpd: PID 2728: tftpd: read: Bad address Jun 11 08:18:38 t9300d Jun 11 08:18:38 t9300d tftpd: PID 1748: t9300d: read request for /cygdrive/i/data/tftp/x: success Jun 11 08:18:38 t9300d Jun 11 08:18:38 t9300d tftpd: PID 1748: tftpd: read: Bad address ================ 5. tftp the same file modified to much more bytes from tftpd32 (http://tftpd32.jounin.net/tftpd32_download.html) tftp server works well ================ $ ls -l /cygdrive/i/data/tftp/x -rwxr-xr-x 1 dfhtys None 512 06-11 08:33 /cygdrive/i/data/tftp/x $ tftp 192.168.0.80 tftp> mode binary tftp> verbose Verbose mode on. tftp> trace Packet tracing on. tftp> get x getting from 192.168.0.80:x to x [octet] sent RRQ <file=x, mode=octet> received DATA <block=1, 512 bytes> sent ACK <block=1> received DATA <block=2, 0 bytes> Received 512 bytes in 0.1 seconds [40960 bits/sec] tftp> ================ 6.source code information from libinetutils/tftpsubs.c ================ /* Simple minded read-ahead/write-behind subroutines for tftp user and server. Written originally with multiple buffers in mind, but current implementation has two buffer logic wired in. Todo: add some sort of final error check so when the write-buffer is finally flushed, the caller can detect if the disk filled up (or had an i/o error) and return a nak to the other side. Jim Guyton 10/85 */ ================ tftpd is not a full tftp server, multiple buffers need to be implemented so that it can transfer big size files, for example to serve PXE file pxelinux.0. by the way, it seems syslogd, inetd and tftpd log one garbage empty message before logging one record.
