<div dir="ltr">Hi All,<div><br></div><div>I am running tftpd server with xinetd on ubuntu lts. </div><div><br></div><div>(xinetd_2.3.14-7ubuntu4_amd64.deb and tftpd_0.17-18ubuntu2_amd64.deb)</div><div><br></div><div>When I try to get a file from ubuntu or debian client it is failing and timing out. When I try to get </div>

<div>the same file over tftp from a centos client it gets the file right away.</div><div><br></div><div>ubuntu/debian tftp client is tftp-hpa 5.2</div><div>centos tftp client is 0.49</div><div><br></div><div>The ubuntu ftp server's xinted.d/tftp file looks like this</div>

<div><br></div><div><div>service tftp</div><div>{</div><div><span class="" style="white-space:pre">     </span>disable<span class="" style="white-space:pre">   </span>= no</div><div><span class="" style="white-space:pre">       </span>socket_type<span class="" style="white-space:pre">               </span>= dgram</div>

<div><span class="" style="white-space:pre">    </span>protocol<span class="" style="white-space:pre">          </span>= udp</div><div><span class="" style="white-space:pre">      </span>wait<span class="" style="white-space:pre">                      </span>= yes</div>

<div><span class="" style="white-space:pre">    </span>user<span class="" style="white-space:pre">                      </span>= root</div><div><span class="" style="white-space:pre">     </span>server<span class="" style="white-space:pre">                    </span>= /usr/sbin/in.tftpd</div>

<div><span class="" style="white-space:pre">    </span>server_args<span class="" style="white-space:pre">               </span>= -s /var/lib/tftpboot</div><div><span class="" style="white-space:pre">     </span>per_source<span class="" style="white-space:pre">                </span>= 11</div>

<div><span class="" style="white-space:pre">    </span>cps<span class="" style="white-space:pre">                       </span>= 100 2</div><div><span class="" style="white-space:pre">    </span>flags<span class="" style="white-space:pre">                     </span>= IPv4</div>

<div>}</div><div><br></div><div>There is no firewall between the servers and all the ubuntu, debian and centos client</div><div>are on same /24 network. </div><div><br></div><div><br></div><div><div>[vagrant@foo ~]$ uname -a</div>

<div>Linux foo 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux</div><div>[vagrant@foo ~]$ tftp -V</div><div>tftp-hpa 0.49, with readline</div><div>[vagrant@foo ~]$ tftp 192.168.0.15 -c get file</div>

<div>[vagrant@foo ~]$ </div></div><div><br></div><div><div>vagrant@debian:~$ uname -a<br></div><div>Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64 GNU/Linux</div><div><div>vagrant@debian:~$ tftp -V</div><div>tftp-hpa 5.2, without readline</div>

</div><div>vagrant@debian:~$ tftp 192.168.0.15 -c get file</div><div>Transfer timed out.</div><div>vagrant@debian:~$ </div></div><div><div><br></div><div>vagrant@foo:~$ uname -a<br></div><div><div>Linux foo 3.2.0-49-generic #75-Ubuntu SMP Tue Jun 18 17:39:32 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux</div>

<div>vagrant@foo:~$ tftp -V</div><div>tftp-hpa 5.2, without readline</div><div>vagrant@foo:~$ tftp 208.47.0.15 -c get file</div><div>Transfer timed out.</div><div>vagrant@foo:~$</div></div><div><br></div><div>compiled tftp-hpa 0.49 with readline on debian and timing out</div>

<div><div>vagrant@debian:~/tftp-hpa-0.49$ tftp -V</div><div>tftp-hpa 0.49, with readline</div><div>vagrant@debian:~/tftp-hpa-0.49$ cd</div><div>vagrant@debian:~$ rm file</div><div>vagrant@debian:~$ tftp 192.168.0.15 -c get fileTransfer timed out.</div>

</div><div><div>Transfer timed out.</div></div><div><br></div><div><div><div>tcpdump on tftpd server shows packets coming in on udp port 69.<br></div></div><div><br></div></div><div><br></div><div>The tftp server has xinetd running OK</div>

</div><div>root     51282     1  0 16:55 ?        00:00:00 /usr/sbin/xinetd -dontfork -pidfile /var/run/xinetd.pid -stayalive -inetd_compat -inetd_ipv6<br></div><div><br></div><div>last few lines from working tftp client (centos)</div>

<div><br></div><div><div> sendto(3, "\0\1file\0netascii\0", 16, 0, {sa_family=AF_INET, sin_port=htons(69), sin_addr=inet_addr("192.168.0.15")}, 16) = 16</div><div> alarm(5) = 0</div><div> recvfrom(3, "\0\3\0\1this is a test\r\n", 516, 0, {sa_family=AF_INET, sin_port=htons(50220), sin_addr=inet_addr("192.168.0.15")}, [16]) = 20</div>

<div> alarm(0) = 5</div><div> sendto(3, "\0\4\0\1", 4, 0, {sa_family=AF_INET, sin_port=htons(50220), sin_addr=inet_addr("192.168.0.15")}, 16) = 4</div><div> write(4, "this is a test\r", 15) = 15</div>

<div> lseek(4, 14, SEEK_SET) = 14</div><div> write(4, "\n", 1) = 1</div><div> close(4) = 0</div><div> munmap(0x7fd64b797000, 4096) = 0</div><div> exit_group(0) = ?</div></div><div><br></div><div>last few lines from not working tftp client (ubuntu and debian)</div>

<div><div><br></div><div>sendto(3, "\0\1file\0netascii\0", 16, 0, {sa_family=AF_INET, sin_port=htons(69), sin_addr=inet_addr("192.168.0.15")}, 16) = 16</div><div>alarm(5)                                = 0</div>

<div>recvfrom(3, 0x606b24, 516, 0, 0x7fff3159f820, 0x7fff3159f808) = ? ERESTARTSYS (To be restarted)</div><div>--- SIGALRM (Alarm clock) @ 0 (0) ---</div><div>rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0</div><div>sendto(3, "\0\1file\0netascii\0", 16, 0, {sa_family=AF_INET, sin_port=htons(69), sin_addr=inet_addr("192.168.0.15")}, 16) = 16</div>

<div>alarm(5)                                = 0</div><div>recvfrom(3, 0x606b24, 516, 0, 0x7fff3159f820, 0x7fff3159f808) = ? ERESTARTSYS (To be restarted)</div><div>--- SIGALRM (Alarm clock) @ 0 (0) ---</div><div>fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0</div>

<div>mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f942b3bf000</div><div>write(1, "Transfer timed out.\n", 20Transfer timed out.</div><div>)   = 20</div><div>rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0</div>

<div>exit_group(69)                          = ?</div></div><div><br></div><div><br></div><div>xinetd debug output when tftp client is working</div><div><br></div><div><div>14/3/6@17:29:56: DEBUG: 37026 {main_loop} select returned 1</div>

<div>14/3/6@17:29:56: DEBUG: 37026 {svc_suspend} Suspended service tftp</div><div>14/3/6@17:29:56: DEBUG: 37026 {server_start} Starting service tftp</div><div>14/3/6@17:29:56: DEBUG: 37026 {main_loop} active_services = 0</div>

<div>14/3/6@17:29:56: DEBUG: 37051 {exec_server} duping 6</div><div>14/3/6@17:29:56: DEBUG: 37026 {main_loop} active_services = 0</div><div>14/3/6@17:29:56: DEBUG: 37026 {main_loop} select returned 1</div><div>14/3/6@17:29:56: DEBUG: 37026 {check_pipe} Got signal 17 (Child exited)</div>

<div>14/3/6@17:29:56: DEBUG: 37026 {child_exit} waitpid returned = 37051</div><div>14/3/6@17:29:56: DEBUG: 37026 {server_end} tftp server 37051 exited</div><div>14/3/6@17:29:56: DEBUG: 37026 {drain} UDP socket should be empty</div>

<div>14/3/6@17:29:56: DEBUG: 37026 {svc_resume} Resumed service tftp</div><div>14/3/6@17:29:56: DEBUG: 37026 {child_exit} waitpid returned = -1</div><div>14/3/6@17:29:56: DEBUG: 37026 {main_loop} active_services = 1</div>

</div><div><br></div><div><br></div><div>xinetd debug out when tftp client is timing out</div><div><br></div><div><div>14/3/6@17:30:22: DEBUG: 37026 {main_loop} select returned 1</div><div>14/3/6@17:30:22: DEBUG: 37026 {svc_suspend} Suspended service tftp</div>

<div>14/3/6@17:30:22: DEBUG: 37026 {server_start} Starting service tftp</div><div>14/3/6@17:30:22: DEBUG: 37026 {main_loop} active_services = 0</div><div>14/3/6@17:30:22: DEBUG: 37315 {exec_server} duping 6</div><div>14/3/6@17:30:22: DEBUG: 37026 {main_loop} active_services = 0</div>

<div>14/3/6@17:30:22: DEBUG: 37026 {main_loop} select returned 1</div><div>14/3/6@17:30:22: DEBUG: 37026 {check_pipe} Got signal 17 (Child exited)</div><div>14/3/6@17:30:22: DEBUG: 37026 {child_exit} waitpid returned = 37315</div>

<div>14/3/6@17:30:22: DEBUG: 37026 {server_end} tftp server 37315 exited</div><div>14/3/6@17:30:22: DEBUG: 37026 {drain} UDP socket should be empty</div><div>14/3/6@17:30:22: DEBUG: 37026 {svc_resume} Resumed service tftp</div>

<div>14/3/6@17:30:22: DEBUG: 37026 {child_exit} waitpid returned = -1</div><div>14/3/6@17:30:22: DEBUG: 37026 {main_loop} active_services = 1</div><div>14/3/6@17:30:32: DEBUG: 37026 {main_loop} select returned 1</div><div>

14/3/6@17:30:32: DEBUG: 37026 {svc_suspend} Suspended service tftp</div><div>14/3/6@17:30:32: DEBUG: 37026 {server_start} Starting service tftp</div><div>14/3/6@17:30:32: DEBUG: 37026 {main_loop} active_services = 0</div>

<div>14/3/6@17:30:32: DEBUG: 37362 {exec_server} duping 6</div><div>14/3/6@17:30:32: DEBUG: 37026 {main_loop} active_services = 0</div><div>14/3/6@17:30:32: DEBUG: 37026 {main_loop} select returned 1</div><div>14/3/6@17:30:32: DEBUG: 37026 {check_pipe} Got signal 17 (Child exited)</div>

<div>14/3/6@17:30:32: DEBUG: 37026 {child_exit} waitpid returned = 37362</div><div>14/3/6@17:30:32: DEBUG: 37026 {server_end} tftp server 37362 exited</div><div>14/3/6@17:30:32: DEBUG: 37026 {drain} UDP socket should be empty</div>

<div>14/3/6@17:30:32: DEBUG: 37026 {svc_resume} Resumed service tftp</div><div>14/3/6@17:30:32: DEBUG: 37026 {child_exit} waitpid returned = -1</div><div>14/3/6@17:30:32: DEBUG: 37026 {main_loop} active_services = 1</div>

<div>14/3/6@17:30:37: DEBUG: 37026 {main_loop} select returned 1</div><div>14/3/6@17:30:37: DEBUG: 37026 {svc_suspend} Suspended service tftp</div><div>14/3/6@17:30:37: DEBUG: 37026 {server_start} Starting service tftp</div>

<div>14/3/6@17:30:37: DEBUG: 37026 {main_loop} active_services = 0</div><div>14/3/6@17:30:37: DEBUG: 37385 {exec_server} duping 6</div><div>14/3/6@17:30:37: DEBUG: 37026 {main_loop} active_services = 0</div><div>14/3/6@17:30:37: DEBUG: 37026 {main_loop} select returned 1</div>

<div>14/3/6@17:30:37: DEBUG: 37026 {check_pipe} Got signal 17 (Child exited)</div><div>14/3/6@17:30:37: DEBUG: 37026 {child_exit} waitpid returned = 37385</div><div>14/3/6@17:30:37: DEBUG: 37026 {server_end} tftp server 37385 exited</div>

<div>14/3/6@17:30:37: DEBUG: 37026 {drain} UDP socket should be empty</div><div>14/3/6@17:30:37: DEBUG: 37026 {svc_resume} Resumed service tftp</div><div>14/3/6@17:30:37: DEBUG: 37026 {child_exit} waitpid returned = -1</div>

<div>14/3/6@17:30:37: DEBUG: 37026 {main_loop} active_services = 1</div><div>14/3/6@17:30:42: DEBUG: 37026 {main_loop} select returned 1<br></div><div>14/3/6@17:30:42: DEBUG: 37026 {svc_suspend} Suspended service tftp</div>

<div>14/3/6@17:30:42: DEBUG: 37026 {server_start} Starting service tftp</div><div>14/3/6@17:30:42: DEBUG: 37026 {main_loop} active_services = 0</div><div>14/3/6@17:30:42: DEBUG: 37407 {exec_server} duping 6</div><div>14/3/6@17:30:42: DEBUG: 37026 {main_loop} active_services = 0</div>

<div>14/3/6@17:30:42: DEBUG: 37026 {main_loop} select returned 1</div><div>14/3/6@17:30:42: DEBUG: 37026 {check_pipe} Got signal 17 (Child exited)</div><div>14/3/6@17:30:42: DEBUG: 37026 {child_exit} waitpid returned = 37407</div>

<div>14/3/6@17:30:42: DEBUG: 37026 {server_end} tftp server 37407 exited</div><div>14/3/6@17:30:42: DEBUG: 37026 {drain} UDP socket should be empty</div><div>14/3/6@17:30:42: DEBUG: 37026 {svc_resume} Resumed service tftp</div>

<div>14/3/6@17:30:42: DEBUG: 37026 {child_exit} waitpid returned = -1</div><div>14/3/6@17:30:42: DEBUG: 37026 {main_loop} active_services = 1</div><div><br></div></div><div><div>Any suggestion on how to troubleshoot this? </div>

<div><br></div><div>(In ubuntu, complled all tftp-hpa versions from 0.49 to 5.2 and when run the above tftp</div><div>command it crashes)</div></div><div><br></div>-- <br>Asif Iqbal<br>PGP Key: 0xE62693C5 KeyServer: <a href="http://pgp.mit.edu">pgp.mit.edu</a><br>

A: Because it messes up the order in which people normally read text.<br>Q: Why is top-posting such a bad thing?<br><br>
</div></div>